Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import scrapy
  2.  
  3. class LinkSpider(scrapy.Spider):
  4. name = "links"
  5. start_urls = [
  6. 'https://www.wikipedia.org/',
  7. ]
  8.  
  9. def parse(self, response):
  10. for link in response.xpath('//div/ul/li/a'):
  11. yield{
  12. 'link': link.extract()
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement