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
When using tab.wait_for during page navigation, this error occurs occasionally. (happens once every ~10 runs)
Traceback (most recent call last):
File "/home/mkofdwu/domagent_test.py", line 19, in <module>
asyncio.run(main())
~~~~~~~~~~~^^^^^^^^
File "/usr/lib64/python3.13/asyncio/runners.py", line 194, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/usr/lib64/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/lib64/python3.13/asyncio/base_events.py", line 721, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/home/mkofdwu/domagent_test.py", line 16, in main
el = await page.wait_for('#APjFqb')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mkofdwu/.local/lib/python3.13/site-packages/zendriver/core/tab.py", line 1131, in wait_for
item = await self.query_selector(selector)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mkofdwu/.local/lib/python3.13/site-packages/zendriver/core/tab.py", line 459, in query_selector
node_id = await self.send(cdp.dom.query_selector(doc.node_id, selector))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mkofdwu/.local/lib/python3.13/site-packages/zendriver/core/connection.py", line 481, in send
raise e
File "/home/mkofdwu/.local/lib/python3.13/site-packages/zendriver/core/connection.py", line 477, in send
return await tx
^^^^^^^^
zendriver.core.connection.ProtocolException: Could not find node with given id
command:DOM.querySelector
params:{'nodeId': NodeId(1), 'selector': '#APjFqb'} [code: -32000]
It seems that every time this error is raised disable_dom_agent also fails, presumably because the dom agent is already disabled. This might also be the same reason why the node with id 1 doesn't exist. Im guessing that the dom agent is disabled during navigation for unknown reasons (?).
When using tab.wait_for during page navigation, this error occurs occasionally. (happens once every ~10 runs)
Example code:
It seems that every time this error is raised disable_dom_agent also fails, presumably because the dom agent is already disabled. This might also be the same reason why the node with id 1 doesn't exist. Im guessing that the dom agent is disabled during navigation for unknown reasons (?).
Commenting out the raise statement at https://github.com/stephanlensky/zendriver/blob/main/zendriver/core/tab.py#L476, wait_for returns the element as expected. I'm not sure what was the intention with disabling the dom agent and re-raising the error.
I'm using the latest version 0.5.1, on fedora workstation 41.
Thanks!
The text was updated successfully, but these errors were encountered: