nonoCAPTCHA icon indicating copy to clipboard operation
nonoCAPTCHA copied to clipboard

wait_for_checkbox() timeout

Open 1dragosh opened this issue 6 years ago • 3 comments

I'm trying to load an Invisible Captcha, but it always times out on wait_for_checkbox().

2019-02-23 12:31:38,249 0 Starting solver with proxy 127.0.0.1:8080
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 74, in start
    result = await self.solve()
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 265, in solve
    await self.loop.create_task(self.wait_for_checkbox())
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 320, in wait_for_checkbox
    timeout=self.animation_timeout)
  File "/home/user/.local/lib/python3.6/site-packages/pyppeteer/frame_manager.py", line 834, in __await__
    raise result
pyppeteer.errors.TimeoutError: Waiting for function failed: timeout 5000ms exceeds.

2019-02-23 12:31:50,160 0 Waiting for function failed: timeout 5000ms exceeds. <class 'pyppeteer.errors.TimeoutError'>
2019-02-23 12:31:50,172 0 Browser closed
2019-02-23 12:31:50,173 0 Time elapsed: 12.192129611968994
2019-02-23 12:31:50,460 1 Starting solver with proxy 127.0.0.1:8080
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 74, in start
    result = await self.solve()
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 265, in solve
    await self.loop.create_task(self.wait_for_checkbox())
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 320, in wait_for_checkbox
    timeout=self.animation_timeout)
  File "/home/user/.local/lib/python3.6/site-packages/pyppeteer/frame_manager.py", line 834, in __await__
    raise result
pyppeteer.errors.TimeoutError: Waiting for function failed: timeout 5000ms exceeds.

2019-02-23 12:32:01,685 1 Waiting for function failed: timeout 5000ms exceeds. <class 'pyppeteer.errors.TimeoutError'>
2019-02-23 12:32:01,697 1 Browser closed
2019-02-23 12:32:01,698 1 Time elapsed: 11.511975288391113
2019-02-23 12:32:01,996 2 Starting solver with proxy 127.0.0.1:8080
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 74, in start
    result = await self.solve()
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 265, in solve
    await self.loop.create_task(self.wait_for_checkbox())
  File "/home/user/.local/lib/python3.6/site-packages/nonocaptcha/solver.py", line 320, in wait_for_checkbox
    timeout=self.animation_timeout)
  File "/home/user/.local/lib/python3.6/site-packages/pyppeteer/frame_manager.py", line 834, in __await__
    raise result
pyppeteer.errors.TimeoutError: Waiting for function failed: timeout 5000ms exceeds.

2019-02-23 12:32:13,226 2 Waiting for function failed: timeout 5000ms exceeds. <class 'pyppeteer.errors.TimeoutError'>
2019-02-23 12:32:13,238 2 Browser closed
2019-02-23 12:32:13,238 2 Time elapsed: 11.52773904800415
2019-02-23 12:32:13,517 3 Starting solver with proxy 127.0.0.1:8080
^CTraceback (most recent call last):
  File "test.py", line 171, in <module>
    loop.run_until_complete(r.main())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 460, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 427, in run_forever
    self._run_once()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 1404, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 445, in select
    fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt

1dragosh avatar Feb 23 '19 12:02 1dragosh

Can you try the latest commit and set retain_source=False in Solver? Example

        client = Solver(
            pageurl,
            sitekey,
            options=options,
            proxy=proxy,
            proxy_auth=proxy_auth,
            retain_source=False
        )

This will make the widget visible for the solver to work correctly.

mikeyy avatar Feb 24 '19 07:02 mikeyy

It does load now, but only gets detected.

1dragosh avatar Feb 25 '19 12:02 1dragosh

To stay on the subject, retain_source=False only works with this settings:

debug: true  # Output current actions and resulting state in console
headless: true  # Run Chrome without a GUI (background)
keyboard_traverse: false  # Emulate keyboard shortcuts instead of mouse behaviors
block_images: false  # Reject requests to all image resource types

timeout:
    page_load: 5  # Length to wait for page load in seconds
    iframe: 30  # Length to wait for iframe to render in seconds
    animation: 10  # Length to wait for animations, such as spinning wheel after
                  # clicking the widget's checkbox

retain_source=False will only work if block_images is set to false, otherwise the widget doesn't get injected.

1dragosh avatar Feb 27 '19 10:02 1dragosh