Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: cannot unpack non-iterable NoneType object #2119

Open
irrisolto opened this issue Jan 17, 2025 · 0 comments
Open

TypeError: cannot unpack non-iterable NoneType object #2119

irrisolto opened this issue Jan 17, 2025 · 0 comments

Comments

@irrisolto
Copy link

Hi, i have this code:

async def get_MYSITE_browser_data(user_agent=None):
    browser = await uc.start(headless=True,browser_args=["--user-agent="+user_agent if user_agent else ""])
    page = await browser.get('MYSITE')
    await page.wait(2)
    cookies = {cookie.name: cookie.value for cookie in (await browser.cookies.get_all())}

    return {
        "cookies": cookies,
        "user_agent": user_agent
    }

When i'm running it on my desktop it works fine but on my raspberry pi 3b i get this error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "<stdin>", line 1, in main
  File "/root/project/myproject.py", line 8, in get_x_data_browser
    browser = await uc.start(headless=True,browser_args=["--user-agent="+user_agent if user_agent else "","--headless=new"])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/nodriver/core/util.py", line 95, in start
    return await Browser.create(config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/nodriver/core/browser.py", line 90, in create
    await instance.start()
  File "/usr/local/lib/python3.11/dist-packages/nodriver/core/browser.py", line 393, in start
    await self.connection.send(cdp.target.set_discover_targets(discover=True))
  File "/usr/local/lib/python3.11/dist-packages/nodriver/core/connection.py", line 413, in send
    await self._prepare_headless()
  File "/usr/local/lib/python3.11/dist-packages/nodriver/core/connection.py", line 492, in _prepare_headless
    response, error = await self._send_oneshot(
    ^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object

Do you know what it could be? I'm using chromium installed via APT

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant