Home > other >  How to determine the python crawler express 100 temp cost
How to determine the python crawler express 100 temp cost

Time:09-20

Temp is become,

CodePudding user response:

Access to the page for the first time, getting temp value,
Cycle:
Mail number and temp value query
Get mail track and update the temp value,


Should be like this?

CodePudding user response:

A few days ago someone asked, there is a temp in js generation algorithm, is a random number, can look for ourselves

CodePudding user response:

reference 1/f, old coconut response:
access page for the first time, getting temp value,
Cycle:
Mail number and temp value query
Get mail track and update the temp value,


Should be like this?

As if heard use cookies knowledge, learning

CodePudding user response:

This parameter is a random number generation, and MATH. The random

You look for them

CodePudding user response:

I also encountered this problem today, I found the JS, random number is upstairs said, but I use Java to produce random number to query, or inaccurate, the returned logistics information is wrong, I don't know the building Lord now?

CodePudding user response:

reference 5 floor waste - I reply:
I also encountered this problem today, I found the JS, random number is upstairs said, but I use Java to produce random number to query, or inaccurate, the returned logistics information is wrong, I don't know the building Lord now?


Has been solved, cookies

CodePudding user response:


The problem, look at how to solve!

CodePudding user response:

Blogger you crawl express solved

CodePudding user response:

reference 5 floor waste - I reply:
I also encountered this problem today, I found the JS, random number is upstairs said, but I use Java to produce random number to query, or inaccurate, the returned logistics information is wrong, I don't know the building Lord now?

This express query your success

CodePudding user response:

Tmpe=random. The random ()
Generate a random number
With this you can generate the
Headers to join inside
'cookies',' Referer '
These can query the success

CodePudding user response:

Copy down all of the headers and formatting, tem used to generate the random, because it is a temporary cookie, so time is very short, if failed, need to update the headers,

A="' Accept: application/json, text/javascript, */*; Q=0.01
The Accept - Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh; Q=0.9, en - US; Q=0.8, en. Q=0.7
Connection: keep alive -
Cookie: csrftoken=S6AsiEvj_aeKAitoFBhsCuLEB3v_5o6Vk5jjLy6X02U; WWWID=WWW00DA2B91FED48DF5680A88F0047C710A; Hm_lvt_22ea01af58ba2be0fec7c11b25e88e6c=1582049778158049, 785158051, 025158051, 270; Hm_lpvt_22ea01af58ba2be0fec7c11b25e88e6c=1582051270
DNT: 1
Host: www.kuaidi100.com
The Referer: https://www.kuaidi100.com/
The Sec - Fetch - Mode: cors
The Sec - Fetch - Site: same origin -
The user-agent: Mozilla/5.0 (Windows NT 10.0; Win64. X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
X - Requested - With: XMLHttpRequest "'

Headers={}
For x in a.s plit (' \ n ') :
K, v=x.s plit (' : ', 1)
Headers [k]=v


# call Requests module
The import requests
Import the random

Express_com=input (' please enter the express company: ') or 'zhongtong'
Postid=input (' please enter the express a single number: ') or 73124161428372

Url_cookies='https://www.kuaidi100.com/globalauto.do'
Params={
'type' : express_com,
"Postid", postid,
'temp' : random. The random (),
'phone' : '
}

Url='https://www.kuaidi100.com/query'

Res=requests. Get (url, headers=headers, params=params)
# print (res) status_code)
Js=res. Json ()
For s in js (' data ') :
The context=[' context '] s
Ftime=[' ftime '] s
Print (ftime, ' ', the context)

CodePudding user response:

Another don't need to update the cookie, is used to close the content of 8, request. Get home page for cookies, then use the cookie to login
# call Requests module
The import requests, json
Import the random

Headers={
'Referer:' https://www.kuaidi100.com/',
'the user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64. X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36 X - Requested - With: XMLHttpRequest '
}

Url_home='https://www.kuaidi100.com/'
Res_home=requests. Get (url_home, headers=headers)
Headers [' cookies']=json. Dumps (requests. Utils. Dict_from_cookiejar (res_home. Cookies))

Express_com=input (' please enter the express company: ') or 'zhongtong'
Postid=input (' please enter the express a single number: ') or 73124161428372

Url_cookies='https://www.kuaidi100.com/globalauto.do'
Params={
'type' : express_com,
"Postid", postid,
'temp' : random. The random (),
'phone' : '
}

Url='https://www.kuaidi100.com/query'

Res=requests. Get (url, headers=headers, params=params)
# print (res) status_code)
Js=res. Json ()
For s in js (' data ') :
The context=[' context '] s
Ftime=[' ftime '] s
Print (ftime, ' ', the context)

CodePudding user response:

Test proves that the temp can also use fixed values,

CodePudding user response:

reference 13 floor smaltore reply:
test proved that the temp can also use fixed values,
fixed value found out you are right?

CodePudding user response:

As constant value found out the is wrong

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related