Skip to content

Instantly share code, notes, and snippets.

@FernandoCelmer
Last active April 11, 2023 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoCelmer/1303f99b8f81f96c8daf27566e534677 to your computer and use it in GitHub Desktop.
Save FernandoCelmer/1303f99b8f81f96c8daf27566e534677 to your computer and use it in GitHub Desktop.
import scrapy
class BlogSpider(scrapy.Spider):
name = 'blogspider'
start_urls = ['https://www.zyte.com/blog/']
def parse(self, response):
for title in response.css('.oxy-post-title'):
yield {'title': title.css('::text').get()}
for next_page in response.css('a.next'):
yield response.follow(next_page, self.parse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment