Use Python to sign in to Web pages and sign in automatically

Source: Internet
Author: User

It is very convenient to touch the Python operation webpage recently. Many websites in order to paste the user, asked to sign in every day to send points, and we are so busy to do this ah, Python can automatically help us do this thing.

Experiment site:www.shuobar.com, this is a free phone call site, used to call at any time for free, but now only 12 o'clock noon before the free, other time to call points, daily check-in can send some points

Experimental Method:Pyhton programming under Windows

1, the user's login. www.shuobar.com Use QQ Authorization login, do not provide account password login mode, which brings some inconvenience to automatic check-in, first study the principle of QQ authorization login.

Use Firefox or Google browser to open www.shuobar.cn home page, prompted to use a key QQ login, open Firefox or Goolge browser with the debugging tools, in fact, right click on the page, select "View elements" can be.

Click the QQ one-button login button, will be to the QQ licensing page, I did not know the principle of QQ authorization, but through the test, www.shuobar.cn's authorization page URL has been

Http://openapi.qzone.qq.com/oauth/show?which=Login&display=pc&response_type=code&client_id= 100478975&redirect_uri=http%3a%2f%2fwww.shuobar.cn%2fuser%2fqqlogincallback.html&scope=get_user_info

So, I guess just post something on this page, and now test what you need to post.

2. Post data analysis

Using the browser's own debug tool, you can see what the post is at the time of authorization, and watch the page post data as shown below.

Response_type:codeclient_id:100478975redirect_uri:http://www.shuobar.cn/user/qqlogincallback.htmlscope:get_ USER_INFOSTATE:SRC:1UPDATE_AUTH:0OPENAPI: #g_tk: 1420953836auth_time:1425356396524ui: E2e88641-4784-46a5-96e1-95a0bd67af80
client_id Presumably is www.shuobar.cn this site ID, this will not change, g_tk do not know what is a thing, but it does not seem to change, only Auth_time and the UI will change, we just have to find these two things, Just post it on the line.
Auth_time is obviously the time now, this can be easily obtained using Python, So what is the UI ?

Use Python to sign in to Web pages and sign in automatically

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.