Ultra-detailed python crawler cracking anti-climbing technology, teach you to crack the slide verification code

 

 

Introduction to identification of sliding verification codes

The objectives of this section:

The verification of the verification slide verification code with the program includes the steps of analyzing the identification idea, identifying the position of the gap, generating the slider drag path, and simulating the verification of the slider combination. Ready to work:

In this case, the Python library we use is Selenium, and the browser is Chrome. Please make sure that the Selenium library and ChromeDriver browser driver are installed.

Learn about the ultimate verification sliding verification code:

The official website of the ultimate slide verification code is: http://www.geetest.com/

The verification method is to drag the slider to flatten the image. If the image is completely flat, the verification is successful, otherwise it needs to be verified again, as shown in the figure:

 

Implementation steps:

① Initialization

Initialize the link address, create a simulated browser object, set the login account and password and other information.

② Fill in the simulation login, click on the slider to verify

  • After instantiating the CrackGeetest object, call the crack () method to start simulated login verification ...
  • Call the open () method, open the login interface, obtain the account and password input box node, and complete the account and password input.
  • Call the get_geetest_button () method to get the sliding verification button and click it.

 

③ Obtain and store two pictures without gaps

  • First obtain the verification image without gaps and save it to the local
  • Get the slider object and perform a click to display the gapped image in the browser
  • Obtain a gapped verification picture and save it locally

④ Obtain the gap position

  • Compare all the RBG pixels of the two pictures to get the x value of different pixels, that is, the distance to be moved

 

⑤ Get moving track

Simulate people's behavior and habits (drag evenly and then drag slowly), and divide the total distance to be dragged into a small trajectory

 

⑥ Drag according to the track to fully verify

 

⑦ Complete login

 

Guess you like

Origin www.cnblogs.com/python0921/p/12752590.html