Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- class LinkSpider(scrapy.Spider):
- name = "links"
- start_urls = [
- 'https://www.wikipedia.org/',
- ]
- def parse(self, response):
- for link in response.xpath('//div/ul/li/a'):
- yield{
- 'link': link.extract()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement