-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
I am using poetry v1.8.0a1 and trying to use edge browser v88.0.705.68 (Official Build) (64-bit)
For some reason, it does not come out of with statement:
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
browser = p.chromium.launch(
executable_path=r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", headless=False
)
page = browser.new_page()
page.goto("http://www.google.com/")
browser.close()
I had to press control+C to come out of the context which again throws an exception:
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "C:\Users\username\AppData\Local\pypoetry\Cache\virtualenvs\windows-automation-kits-RkQ0kSwR-py3.8\lib\site-packages\playwright\sync_api\_generated.py", line 10012, in close
result = mapping.from_maybe_impl(self._sync(self._impl_obj.close()))
File "C:\Users\username\AppData\Local\pypoetry\Cache\virtualenvs\windows-automation-kits-RkQ0kSwR-py3.8\lib\site-packages\playwright\_impl\_sync_base.py", line 88, in _sync
self._dispatcher_fiber.switch()
File "C:\Users\username\AppData\Local\pypoetry\Cache\virtualenvs\windows-automation-kits-RkQ0kSwR-py3.8\lib\site-packages\playwright\sync_api\_context_manager.py", line 48, in greenlet_main
loop.run_until_complete(self._connection.run_as_sync())
File "c:\python38\lib\asyncio\base_events.py", line 603, in run_until_complete
self.run_forever()
File "c:\python38\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()
File "c:\python38\lib\asyncio\base_events.py", line 570, in run_forever
self._run_once()
File "c:\python38\lib\asyncio\base_events.py", line 1823, in _run_once
event_list = self._selector.select(timeout)
File "c:\python38\lib\asyncio\windows_events.py", line 430, in select
self._poll(timeout)
File "c:\python38\lib\asyncio\windows_events.py", line 779, in _poll
status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
KeyboardInterrupt
Can we seen in interactive mode also:
>>> from playwright.sync_api import sync_playwright
>>> playwright = sync_playwright().start()
>>> browser = playwright.chromium.launch(executable_path=r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", headless=False)
>>> page = browser.new_page()
>>> page.goto("http://whatsmyuseragent.org/")
<playwright.sync_api._generated.Response object at 0x0000020489B9DA60>
>>> browser.close()