1
28
2016
8

使用python3 request模块模拟登录

首先我们使用request模块模拟登录是一件非常简单的事情,但是我花了一晚上的时间来弄明白他

s = request.Session()
data = {"Username":"xxxx","Password":"xxxx"}
headers = {"User-Agent":"........."}
url_login = r"http://xxxx.xxxxxxxxxxxxxx"
url = r"http://xxx.xxxxxxxx.xxxxx"
s.post(url_login,data,headers = header)
ret = s.get(url)

 

看起来非常简单,但是因为url_login并不是你的login界面,而是命令发出的一个界面……所以如何找到这个网址就成了我一个晚上都在研究的问题

 

方式1: 无数次实验登录并跟踪

失败原因: 跳转过程中post命令在审查元素里面没有了

 

方式2: 找firebug

失败原因: 好像下不来

 

终于来到伟大的方法三:

输入一个错误的密码看她的Query-string

 

然后就好了

感觉自己的智商被完草。。。

Category: 未分类 | Tags: python 爬虫 | Read Count: 11644
Avatar_small
housekeeping service 说:
2019年9月12日 14:49

Happy Maids not to mention all experienced cleaners together do whatever they do just fine because many follow a surefire system. Their approach happens to be tailored providing a worker on a cleaning service giving professional good cleaning on an efficient instance manne.

Avatar_small
dui lawyer montreal 说:
2020年6月04日 19:07

Students trying to turn into attorneys should successfully complete the best amount involving schooling. Students ought to complete a unique level involving education so as to practice legislations. Online colleges and universities offer individuals numerous chances to phase into jobs.

Avatar_small
wendy wood law 说:
2020年6月04日 19:07

The practice involving family law are going to be examined within this concentration. Students figure out how to handle child custody disputes, separations, abuse circumstances, and additional. Education normally includes standard criminal legislations and the many necessary family members law training. Adoption legislations, legal protection under the law of young children, and nontraditional family members law are generally some training taken.

Avatar_small
star lite shopping m 说:
2020年6月04日 19:08

The very idea of a charitable trust shop can vary from land to land. For occasion, it is termed thrift keep, resale look, hospice shop in the us and Nova scotia, Opportunity (op) look in Questionnaire and Brand-new Zealand along with 2nd side shop throughout Malaysia.

Avatar_small
shopping batalha 说:
2020年6月04日 19:08

On-line shopping can be rapidly becoming the 1st choice of folks on the globe for up graiding or classic shopping. Slowly, online shopping has accepted because new along with fashionable technique of shopping.

Avatar_small
elimperio travel 说:
2020年6月04日 19:09

With average person access on the Internet, many airlines and also other travel companies did start to sell straight away to passengers. Consequently, airlines don't needed to spend the commissions to search agents in each priced sold. Considering that 1997, travel businesses have slowly been disintermediated(Cutting the center man).

Avatar_small
part time maids in d 说:
2020年6月11日 16:30

you'll find a number of the major things you should consider before investing a cleaning service service. While that is certainly not an inclusive guide, it should offer you a valuable kick off point in making an educated decision.

Avatar_small
painting services in 说:
2020年6月11日 16:30

Think of Ungaretti & Harris, a lawyers in Chi town that triumphed in bragging rights and much good ink when it all became the main law firm in the nation to think of a penned service warranty. The solid pledges cost-effective together with timely provider and superior communication when using the client.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com