Use Selenium + win32api crack Ali sliding verification code

Login and elsewhere appear to slide pig short rent is Ali's slide

2019-10-23 Update:

To a single connection:


`https://bizverify.xiaozhu.com/?slideRedirect=https%3A%2F%2Fwww.xiaozhu.com%2Fxzweb.php%3Fop%3DFangDong_MyRentCalendar%26lodgeUnitId%3D117800367601`

Before the program, the login screen is entirely possible, but not entirely in the interface, slide several failed several times. The success rate 0

So, update a solution:

Reference: [Department of pure slider Ali verification code to crack thinking] (https://blog.csdn.net/weixin_41733260/article/details/93160484)

Ali slider verification code beginning with nc_1, implemented by calling XXXnc.js. 

For example, China visual landing page www.vcg.com/ the Login 

for such verification code, perform JS crack is relatively rare, so it should be cracked by selenium. 
In the crack process will encounter are identified sites out, usually behind send_keys and then click and drag the landing, but most of this does not work, most of Ali's js identified. 

Is probably occurs: 

when the browser is maximized to identify 

the sliding action of execution is recognized 

send_keys after recognition 

processing logic is: 

open the browser, after maximizing get (url) and then refresh the page. 

Slide the slider can not use webdriver, pynput use this module to do the drag operation, the library is a relatively low-level, call win32. Before pyautogui found not estimated to be encapsulated several times, it has been identified out

 

 

I just simply in order to break the slide, so the direct use pynput entirely possible.

 

-------------------------------------------------- -----------split line------------------------------------- --------------------------------

 

From 118 to 119, 120 to now.

Just started using selenium can slide success, since updates to 120 after, before I wrote the code becomes ineffective.

The basic analog slide will not succeed.

Check the analog and slide in the sliding pages difference found generated parameter n, differ greatly

After the test found, the update will detect system-level sliding the mouse events, while selenium is an external program to control the mouse event, it will fail

Solution

  • Win32API use, system-level control to move the mouse, so long as when the slide,

** mouse has moved  **

Then the slide will be successful. So that is a combination of both to solve this problem.

win32 installation

The library seems directly  pip install pywin32 will not succeed

Another way is to install Quguan network directly download the exe file, download the corresponding version of the file, direct installation, it will automatically detect the installation directory of the python, and install

  • https://sourceforge.net/projects/pywin32/files/pywin32/

But I have not tried using win32api be entirely what the results will produce slide.

Follow-up testing.

I welcome the attention of the public number: Python Reptile scrapy

Guess you like

Origin www.cnblogs.com/andrewablog/p/11725494.html