[Python] nodriver crashes with infinite recursion in headless mode when running browser.get()

Discussão em 'Python' iniciado por Stack, Maio 15, 2025.

  1. Stack

    Stack Membro Participativo

    Here is the code I'm trying to run:

    import nodriver as uc

    async def main():

    browser = await uc.start(headless=True)
    page = await browser.get('https://www.nowsecure.nl')

    if __name__ == '__main__':
    uc.loop().run_until_complete(main())


    Here is the output I get in the terminal:

    File ".venv/lib/python3.12/site-packages/nodriver/core/tab.py", line 217, in _prepare_headless
    resp = await self._send_oneshot(
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".venv/lib/python3.12/site-packages/nodriver/core/connection.py", line 522, in _send_oneshot
    return await self.send(cdp_obj, _is_update=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".venv/lib/python3.12/site-packages/nodriver/core/tab.py", line 208, in send
    await self._prepare_headless()
    File ".venv/lib/python3.12/site-packages/nodriver/core/tab.py", line 217, in _prepare_headless
    resp = await self._send_oneshot(
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".venv/lib/python3.12/site-packages/nodriver/core/connection.py", line 522, in _send_oneshot
    return await self.send(cdp_obj, _is_update=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RecursionError: maximum recursion depth exceeded
    successfully removed temp profile /tmp/uc_8kjtj4bv


    I'm not sure whether this is a bug, or whether I'm doing something wrong (e.g., something is wrong with my environment). In case it was a bug, I tried raising an issue on the repository's github page (https://github.com/ultrafunkamsterdam/nodriver/issues/new), but I keep getting a "Unable to create issue" error. I experimented with another repo and this error did not come up, so I'm assuming the repository owner has turned off issues or something...?

    Continue reading...

Compartilhe esta Página