undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

[NoDriver] Fetch.requestPaused not working

Open namename-123 opened this issue 9 months ago • 10 comments

The code below simply hangs instead of continuing.

async def receive_handler(event: cdp.fetch.RequestPaused):
  print(event.resource_type)
  return cdp.fetch.continue_request(request_id=event.request_id)

async def main():
  options = Options()
  service = Service('C:\Program Files\Google\Chrome\Application\chrome.exe')
  driver = await start(
    service=service,
    options=options,
  )

  cdp.fetch.enable()
  tab = driver.main_tab
  tab.add_handler(cdp.fetch.RequestPaused, receive_handler)

  page = await driver.get('https://abrahamjuliot.github.io/creepjs/')
  
  input("Press Enter to continue...")
  await page.close()

if __name__ == '__main__':

  loop().run_until_complete(main())

namename-123 avatar May 07 '24 04:05 namename-123