You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromplaywright.sync_apiimportsync_playwrightdefrun(playwright):
# launch the browserbrowser=playwright.chromium.launch()
# opens a new browser pagepage=browser.new_page()
# navigate to the websitepage.goto('https://www.511mt.net/#zoom=7.0841341315419255&lon=-107.10223784975705&lat=47.76128392814593&events&road-cond&rwis')
# take a full-page screenshotpage.screenshot(path='example.png', full_page=True)
# always close the browserbrowser.close()
withsync_playwright() asplaywright:
run(playwright)
Expected behavior
I did not expect to get the error show. I expected a screenshot to show up in my folder with the name 'example.png'
Actual behavior
Traceback (most recent call last):
File ~\anaconda3\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File f:\mx_share\python\ytdownload\untitled1.py:23
with sync_playwright() as playwright:
File ~\anaconda3\lib\site-packages\playwright\sync_api_context_manager.py:47 in enter
raise Error(
Error: It looks like you are using Playwright Sync API inside the asyncio loop.
Please use the Async API instead.
Additional context
I see others have had this issue in Jupyter Notebook. I saw one use recommending the following:
playwright install-deps
I tried that as well with the same results. Not really sure how to proceed.
Environment
- Operating System: [Windows 10 Pro ver 10.0.19045]
- CPU: [Dual X5675 @3.07GHz]
- Browser: [Chrome]
- Python Version: [3.9.18]
- Other info: [144 GB RAM]
The text was updated successfully, but these errors were encountered:
Version
1.48
Steps to reproduce
I am using the Spyder IDE version 5.5.1 Python 3.9.18 64 bit
My code (not mine originally can be found at --> https://screenshotone.com/blog/how-to-take-website-screenshots-in-python/#playwright-in-python) is as follows:
Expected behavior
I did not expect to get the error show. I expected a screenshot to show up in my folder with the name 'example.png'
Actual behavior
Traceback (most recent call last):
File ~\anaconda3\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
exec(code, globals, locals)
File f:\mx_share\python\ytdownload\untitled1.py:23
with sync_playwright() as playwright:
File ~\anaconda3\lib\site-packages\playwright\sync_api_context_manager.py:47 in enter
raise Error(
Error: It looks like you are using Playwright Sync API inside the asyncio loop.
Please use the Async API instead.
Additional context
I see others have had this issue in Jupyter Notebook. I saw one use recommending the following:
playwright install-deps
I tried that as well with the same results. Not really sure how to proceed.
Environment
The text was updated successfully, but these errors were encountered: