后台小程序开发的全方位指南
686
2022-10-11
python session登录豆瓣
#coding:utf-8# from HTMLParser import HTMLParserimport sqlite3connect=sqlite3.connect("test.db")# create_sql="create table company(id int PRIMARY key not null,emp_name varchar(20))"# connect.execute(create_sql)# insert_sql="insert into company values(?,?)"# connect.execute(insert_sql,(1,"LU",))# connect.execute(insert_sql,(2,"ggg",))## cursor=connect.execute("select id,emp_name from company")# for row in cursor:# print(row[0],row[1])# print()# connect.close()import requestsimport refrom bs4 import BeautifulSoups=requests.Session()url_login=" "redir":" "form_email":"619617021@qq.com", "form_password":"4565892boy", "login":u"登录"}header_pip={"User-Agent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.3427.400 QQBrowser/9.6.12513.400"}r=requests.post(url_login,data=form_data,headers=header_pip)content=r.textsoup=BeautifulSoup(content)capture=soup.find("img",id="captcha_image")# print(content)if capture: capture_url=capture["src"] print(capture_url) re_captureid='
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~