Python simulates a logged in state through cookies a preliminary study _python

Source: Internet
Author: User

For those crawler operations that need to be performed in a login environment, simulating login or cloaking is a just-needed condition.

Analysis of the online example of analog login, many are based on user name/password to launch a POST request, encountered with a picture verification code, the more ideal method is to carry out manual intervention, the synchronization of the launch of a picture verification code request, the picture written to the local, manual view after the input.

Since, without human intervention, why not the whole process of manual, has logged in and then the browser's cookie information copied out, through the crawler forged into a login browser it? I have tried a few domestic major websites, found that all work, you can simulate the browser to login after a lot of operations, including check-in, modify personal data and so on.

Here's a simple code implementation:

Something: About the picture verification code, why not need to make an automatic recognition?

Because as simple as the following, you might be able to take a few days to get it done:

But many of the site's verification code will continue to transform the strategy, it may change quickly, but for you may have to spend a few days to change the code, perhaps you have not finished, others have changed, in short, play but you can also play dead you.

When it wants to change the posture to give you a surprise, if you have not cracked its last set of verification code, you will regret that the university chose the wrong major:

In order to develop automatic ticketing software, 360 with sophisticated team, also seems to be able to recognize the following anti-human authentication code:

The above is a small set up to introduce Python through cookies to simulate the status of the initial study, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.