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

wait_for_checkbox() timeout #50

Open
1dragosh opened this issue Feb 23, 2019 · 3 comments
Open

wait_for_checkbox() timeout #50

1dragosh opened this issue Feb 23, 2019 · 3 comments

Comments

@1dragosh
Copy link

1dragosh commented Feb 23, 2019

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 1dragosh changed the title animation timeout - wait_for_checkbox() timeout Feb 23, 2019
@mikeyy
Copy link
Owner

mikeyy commented Feb 24, 2019

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.

@1dragosh
Copy link
Author

1dragosh commented Feb 25, 2019

It does load now, but only gets detected.

@1dragosh
Copy link
Author

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.

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

2 participants