diff --git a/main.py b/main.py index 5d151022d0f3d476d922573317df65c422fb58c5..cae6ce6fe9594334150ef61ad6f05d22de6fbaaf 100644 --- a/main.py +++ b/main.py @@ -1 +1,11 @@ -print('欢迎来到 InsCode') +import scrapy + + + +class ExampleSpider(scrapy.Spider): + name = 'example' + start_urls = ['https://www.csdn.net'] + + def parse(self, response): + for link in response.css('a'): + yield {'link': link.css('::attr(href)').get()}