Example of Java selenium processing polar sliding verification code

To climb a website, I encountered a very effective verification code. This week, I was thinking about how to crack this. I searched a lot on the Internet and saw that someone asked this question. I roughly realized it according to this idea.

1. Use htmlunit (I didn't succeed in this way. The track is not generated after the simulation mouse is dragged and can be skipped)

I use Java. I first thought of using htmlunit directly. I did some initialization

Initialize proxy, cookie Then it can be called normally

The following is how I get the picture, restore the picture and simulate dragging. (I think there is some problem here. It may be that my simulation of dragging is wrong, which leads to the triggered JS not generating the correct track. Please help to see what is wrong.)

The comparison image acquisition displacement method (decaptcha) is wrong, so I won't put the code. The following is the method used to restore the image. At present, you can understand how to restore the image after reviewing the elements. Here are 10px and 58px read each time

2. Use selenium

Later, I thought that there was something wrong with my simulated mouse action, so I found selenium (2.42.2). He can also operate the key htmlunit. His mouse action seems to be completely encapsulated

But I found this after trying. The action htmlunitmouse has not been implemented

OK, so call chrome

The form submitted in this way does have a track. I first wrote a fixed value for the moving position, which can be restored by the above image and recognized by some open-source image recognition tools. The above should be able to solve the sliding verification code

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>