Skip to content

Instantly share code, notes, and snippets.

Created May 2, 2022
What would you like to do?
import scrapy
# Run with
# scrapy runspider --set=DEPTH_LIMIT=1 -O table.csv
# set DEPTH_LIMIT accordingly
class BlogSpider(scrapy.Spider):
name = 'wikispider'
start_urls = ['Африканский_пушистый_погоныш']
def parse(self, response):
my_title = response.css('#firstHeading::text').get()
for link in response.css("p > a"):
yield {'from': my_title,
'to': link.css("::text").get()}
yield response.follow(link, self.parse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment