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

[pup2.1.1] async def _onRequestPaused often called with networkId not set in the event after using page.authenticate #461

Open
dgtlmoon opened this issue Feb 10, 2024 · 0 comments

Comments

@dgtlmoon
Copy link

dgtlmoon commented Feb 10, 2024

async def _onRequestPaused(self, event: Dict) -> None:

Maybe related microsoft/playwright#27376

Exception in callback AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...('networkId')>) at /var/www/changedetection.io/.venv/lib/python3.10/site-packages/pyee/asyncio.py:69
handle: <Handle AsyncIOEventEmitter._emit_run.<locals>.callback(<Task finishe...('networkId')>) at /var/www/changedetection.io/.venv/lib/python3.10/site-packages/pyee/asyncio.py:69>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/var/www/changedetection.io/.venv/lib/python3.10/site-packages/pyee/asyncio.py", line 77, in callback
    self.emit("error", exc)
  File "/var/www/changedetection.io/.venv/lib/python3.10/site-packages/pyee/base.py", line 211, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
  File "/var/www/changedetection.io/.venv/lib/python3.10/site-packages/pyee/base.py", line 169, in _emit_handle_potential_error
    raise error
  File "/var/www/changedetection.io/.venv/lib/python3.10/site-packages/pyppeteer/network_manager.py", line 157, in _onRequestPaused
    requestId = event['networkId']
KeyError: 'networkId'

however self._userRequestInterceptionEnabled was False and self._protocolRequestInterceptionEnabled was True

So basically it's happening when I use the proxy authentication, _updateProtocolRequestInterception sets _protocolRequestInterceptionEnabled to True

image


from pyppeteer import Pyppeteer
pyppeteer_instance = Pyppeteer()

browser = await pyppeteer_instance.connect(browserWSEndpoint=self.browser_connection_url,defaultViewport="width": 1024, "height": 768})

await self.page.authenticate(self.proxy)


then the usual page.goto() etc

Sorry for the screenshot..

image

will add more details as I find them

i suspect that recaptcha JS is fired from a sub worker or similar

@dgtlmoon dgtlmoon changed the title [pup2.1.1] async def _onRequestPaused often called with networkId not set in the event (maybe related to fetch happens from within a sub worker) [pup2.1.1] async def _onRequestPaused often called with networkId not set in the event when using proxy credentials Feb 10, 2024
@dgtlmoon dgtlmoon changed the title [pup2.1.1] async def _onRequestPaused often called with networkId not set in the event when using proxy credentials [pup2.1.1] async def _onRequestPaused often called with networkId not set in the event after using page.authenticate Feb 10, 2024
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