Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- class PlaywrightSpider(scrapy.Spider):
- name = 'playwright_spider'
- start_urls = ['https://angular.io/docs']
- def start_requests(self):
- for url in self.start_urls:
- # Set the playwright Request.meta key
- yield scrapy.Request(url, meta={"playwright": True})
- def parse(self, response):
- # Extract the page title
- title = response.css('title::text').get()
- yield {'title': title}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement