Skip to content

Instantly share code, notes, and snippets.

@jason-xuan
Created July 24, 2017 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jason-xuan/c48834c21c5d27ef1e062ad58c86804c to your computer and use it in GitHub Desktop.
Save jason-xuan/c48834c21c5d27ef1e062ad58c86804c to your computer and use it in GitHub Desktop.
爬网易新闻的xpath
title = ''.join(response.xpath("//div[@class='post_content_main']/h1/text()").extract())
text = '\n'.join(response.xpath("//div[@class='post_text']/p/text()").extract())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment