1.场景 很多时候登录操作是比较复杂的,因为存在各种反爆破操作,以及为了安全性提交数据都会存在加密.如果要完全模拟代码去实现登录操作是比较复杂,并且该网站后续更新了登录安全相关功能,那么登录的模拟操作又得修改.但是通过selenium模拟人为登录得操作是永远不会过时.因此一个好得方案就是通过selenium模拟登录,然后拿到可用得Cookie通过requests进行后续得模拟请求. 2.实现代码 import time, requests from selenium import webdriv…
python3+selenium使用浏览器IE的时候,老是报错: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones 这个错误,更改IE的internet选项->安全,将Internet/本地Internet/受信任的站定/受限制的站点中的启用"保护模式"全部去掉勾,或者全部勾上,即可.…
登录操作(方法二:for与else搭配) user_name="star"passwoed='123' count=0for i in range(3): u_username=input("please input your username:") u_password=input("please input your password:") if u_username==user_name and u_password==passwoed:…