Python package crawl China Mobile top-up page---can determine whether the phone number is abnormal

Source: Internet
Author: User

1. Use requests. Session (), you can automate the management of cookies, session, and so on.

2. The specific process can capture packet analysis. All requested parameters such as to be clear need to analyze JS source code. can only hint, altogether divides into three steps:

First step: Get Prov_cd (region number);

The second step: the URL for the dynamic (incoming phone number and the first step obtained prov_cd) post to send JSON data in the way of getting Salecode, Activityno, Operateid.

The cell phone number in JSON needs to be Base64.b64encode (Phone.encode (' UTF-8 ')), and you need to pass the first step to get the PROV_CD

The third step: How to send JSON data by post to get the phone number status is abnormal, order number, serial number and so on. The JSON data requires the parameters returned in step first to second.

3. Three response data are JSON, parsing available json.loads ()

4. Finally don't forget Session.close ().

Python package crawl China Mobile top-up page---can determine whether the phone number is abnormal

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.