playwright and httpx coroutine conflicts,How to solve it? #2501
Unanswered
zgangguoguo
asked this question in
Q&A
Replies: 2 comments
-
|
my solution: with sync_playwright() as playwright:
# code # |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
you didn't provide full error traceback. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I created a BaseSpider class that needs to use playwright and httpx, but in the case of coroutines, they conflict.
code:
but error:
asyncio.run() cannot be called from a running event looprun error:asyncio.run() cannot be called from a running event loop
I comment
# self.play_wright = sync_playwright().start().They're ready to work.How to get Playwright and HTTPX to run together in coroutines?
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions