資源簡介
代碼片段和文件信息
#?-*-?coding:?utf-8?-*-
import?requests
import?re
class?TaoBao:
????def?__init__(selfusername):
????????#?淘寶登錄的URL
????????self.login_url?=?“https://login.taobao.com/member/login.jhtml“
????????#?登陸前的驗證以獲取cookie用于后續的登陸操作
????????self.st_url?=?‘https://login.taobao.com/member/vst.htm?st={st}‘
????????#?淘寶登陸用戶名
????????self.username?=?username
????????#header信息??(設置幾個基本就可以的了,沒必要設置這么多)
????????self.loginHeaders?=?{
????????????‘Host‘:‘login.taobao.com‘
????????????‘Connection‘:‘keep-alive‘
????????????‘Content-Length‘:‘3357‘
????????????‘Cache-Control‘:‘max-age=0‘
????????????‘Origin‘:‘https://login.taobao.com‘
????????????‘Upgrade-Insecure-Requests‘:‘1‘
????????????‘User-Agent‘:‘Mozilla/5.0?(Windows?NT?10.0;?Win64;?x64)?AppleWebKit/537.36?(KHTML?like?Gecko)?Chrome/58.0.3029.110?
- 上一篇:python做簡單做web開發
- 下一篇:python 手動驗證并模擬登錄12306
評論
共有 條評論