python 登录并获取session,使用session新增ecshop的草稿

筅森魡賤 提交于 2019-12-05 20:42:46

 

import requestsheader={"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"}data={"username":"fuhui","password":"P@ssw0rd","act":"act_login","back_act":"./index.php"}s=requests.session()a=s.post("http://localhost/ECshop_v3.6.0/ecshop/user.php",data=data,headers=header)data1={"country":1,"province":10,"city":109,"district":1222,"consignee":"冬天","email":"12345@qq.com","address":"喜欢","tel":"13323457890","submit":"新增收货地址","act":"act_edit_address"}b=s.post("http://localhost/ECshop_v3.6.0/ecshop/user.php",data=data1,headers=header)print(b.text)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!