scrapy-selenium icon indicating copy to clipboard operation
scrapy-selenium copied to clipboard

Keep browser window open after scraping?

Open wondering639 opened this issue 3 years ago • 1 comments

How can one keep the browser window open after scraping has finished (or aborted)? Thanks!

wondering639 avatar Apr 07 '21 18:04 wondering639

@wondering639 There's only a single browser instance created for the lifecycle of the downloader middleware. I suppose all you'd need to do is avoid running this statement when your crawl is finished: https://github.com/clemfromspace/scrapy-selenium/blob/develop/scrapy_selenium/middlewares.py#L139

You can probably accomplish that through subclassing SeleniumMiddleware and overriding spider_closed() w/o having to actually modify any code in the package itself.

Flushot avatar Apr 23 '21 03:04 Flushot