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

The captcha slider could not stay sliding - try a single step and slower motion #399

Closed
Turbolento opened this issue Jun 22, 2022 · 9 comments
Labels

Comments

@Turbolento
Copy link

Hi, I want to simulate the mouse dragging the captcha slider, but it turns out that every time I slide it halfway, the mouse is released.How can I solve these problems? Thanks for the help。

  r.hover(254, -659)
  r.mouse('down')
  r.hover(254, -659)
  r.hover(353, -659)
  r.hover(492, -659)
  r.hover(520, -659)
  r.mouse('up')

1

@kensoh
Copy link
Member

kensoh commented Jun 22, 2022

Thnaks for the detail info and video. I see, I haven't come across this strange behavior. What happens if you slide in one step? The automation will simulate moving the mouse cursor from starting point to end point over 1 second.

r.hover(254, -659)
r.mouse('down')
r.hover(520, -659)
r.mouse('up')

@kensoh kensoh changed the title The captcha slider could not stay sliding Jun 22, 2022
@kensoh kensoh added the query label Jun 22, 2022
@kensoh kensoh changed the title The captcha slider could not stay sliding - try and see if this works Jun 23, 2022
@kensoh kensoh changed the title The captcha slider could not stay sliding - try a single step and see if this works Jun 23, 2022
@Turbolento
Copy link
Author

Thnaks for the detail info and video. I see, I haven't come across this strange behavior. What happens if you slide in one step? The automation will simulate moving the mouse cursor from starting point to end point over 1 second.

r.hover(254, -659) r.mouse('down') r.hover(520, -659) r.mouse('up')

Hi, kensoh, thank you for your kind reply.
I tried to slide in one step, but this captcha security check will not pass, I guess it is due to even speed sliding.
So I tried using selenium to slide using a variable speed and it works.
Is rpa_python able to implement this variable speed sliding?

@kensoh
Copy link
Member

kensoh commented Jun 23, 2022

Oh I see.. I've just checked, the default timing is 0.5 seconds, maybe too fast. You can try below to make it slower -

# setting for mouse movement to 2 seconds
r.vision('Settings.MoveMouseDelay = 2')
@kensoh kensoh changed the title The captcha slider could not stay sliding - try a single step and see if it works Jun 23, 2022
@kensoh kensoh changed the title The captcha slider could not stay sliding - try a single step and slower movement Jun 23, 2022
@Turbolento
Copy link
Author

I did what you said, but it still failed. The error message is "Verification failed, please try again".
image

@Turbolento
Copy link
Author

Turbolento commented Jun 23, 2022

Hi, kensoh, Thank you again for your help.
This issue has been solved. I tried to do like the following code and it worked.

r.vision("""Settings.DelayBeforeMouseDown=0;
Settings.DelayBeforeDrag=0;
Settings.DelayBeforeDrop=0;
Settings.MoveMouseDelay=0.15""")
r.hover(254, -659)
r.mouse('down')
r.hover(353, -659)   # 353 is randomly generated within the range
r.hover(492, -659)   # 492 is randomly generated within the range
r.hover(520, -659)
r.mouse('up')
@kensoh
Copy link
Member

kensoh commented Jun 23, 2022

Amazing, you found the solution!

@kensoh
Copy link
Member

kensoh commented Jun 26, 2022

Adding on, the following settings may not be needed, because rpa package does not uses the dragDrop() function of SikuliX, but directly uses the mouse down --> moving --> mouse up. https://sikulix-2014.readthedocs.io/en/latest/scripting.html

Settings.DelayBeforeMouseDown=0;
Settings.DelayBeforeDrag=0;
Settings.DelayBeforeDrop=0;
@kensoh
Copy link
Member

kensoh commented Jun 26, 2022

This is a good working example, I've added to readme - https://github.com/tebelorg/RPA-Python#api-reference

@kensoh kensoh closed this as completed Jun 26, 2022
@Turbolento
Copy link
Author

Thank you very much! This content is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants