-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playwright with Scrapy? #213
Comments
Hi, such a error normally occurs as you've already pointed out when the pipe is closed. In our case this would happen when you call Thanks! |
Hi, System information: I may have identified why the pipe is closed. Hmmm, I don't master well |
appears to be the same error #178 |
Playwright API can only be used in single async loop. It should be the same thread / loop you started Playwright with loop = asyncio.get_event_loop() and then post tasks onto it. That way everything that talks to Playwright happens within that loop. Depending on whether your app uses multiple threads or multiple loops, you can then call |
Hi Team,
I'm starting a project to provide a Scrapy download manager that executes queries using Playwright. It can be used to process pages that require JavaScript. The design is strongly inspired of Pyppeteer integration for Scrapy (scrapy-pyppeteer).
The main issue when running Scrapy and Playwright together is that Scrapy is using Twisted and that Playwright for Python is using asyncio for async stuff.
Like scrapy-pyppeteer, I make
PlaywrightDownloadHandler
class inherits from the default http/https handler, and it will only use Playwright for requests that are explicitly marked. The basic use is identical to scrapy-pyppeteer Basic usage.The problem is that during the execution of a request (
download_request
) I get the following error:I use chome as headless browser and chrome is well executed.
What I understand is that this type of error occurs when I'm trying to write in a closed stream/connection
What I don't understand is why the stream is closed that it works in
launch_browser
.Can you help me?
Thank you
The text was updated successfully, but these errors were encountered: