Created
July 24, 2017 10:24
-
-
Save jason-xuan/c48834c21c5d27ef1e062ad58c86804c to your computer and use it in GitHub Desktop.
爬网易新闻的xpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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