资源简介
python使用requests模拟登录带验证码的专利网站demo
代码片段和文件信息
import requests
import base64
from bs4 import BeautifulSoup
if __name__ == ‘__main__‘:
checkHeader = {
“Host“: “www.pss-system.gov.cn“
“Proxy-Connection“: “keep-alive“
“Cache-Control“: “max-age=0“
“Origin“: “http://www.pss-system.gov.cn“
“Upgrade-Insecure-Requests“: “1“
“User-Agent“: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/60.0.3112.90 Safari/537.36“
“Content-Type“: “application/x-www-form-urlencoded“
“Accept“: “text/htmlapplication/xhtml+xmlapplication/xml;q=0.9image/webpimage/apng*/*;q=0.8“
“Referer“: “http://www.pss-system.gov.cn/sipopublicsearch/portal/uiIndex.shtml“
“Accept-Encoding“: “gzip deflate“
“Accept-Language“: “zh-CNzh;q=0.8“
}
header = {
“Accept“: “text / html * / *;q = 0.01“
“Accept-Encoding“: “gzip deflate“
“Accept-Language“: “zh-CNzh;q=0.8“
“Content-Type“: “application/x-www-form-urlencoded; charset=UTF-8“
“User-Agent“: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/60.0.3112.90 Safari/537.36“
}
baseUrl = ‘http://www.pss-system.gov.cn/sipopublicsearch/patentsearch/tableSearch-showTableSearchIndex.shtml‘
checkUrl = ‘http://www.pss-system.gov.cn/sipopublicsearch/wee/platform/wee_security_check‘
timeUrl = ‘http://www.pss-system.gov.cn/sipopublicsearch/portal/checkLoginTimes-check.shtml‘
debugUrl = ‘http://www.pss-system.gov.cn/sipopublicsearch/portal/sessionDeBugAC.do‘
codeurl = ‘http://www.pss-system.gov.cn/sipopublicsearch/portal/login-showPic.shtml‘
‘‘‘此处改为大家在专利网注册的账号‘‘‘
strName = ‘‘
strPass = ‘‘
base64Name = str(base64.b64encode(bytes(strNameencoding=‘utf-8‘)) ‘utf-8‘)
base64Pass = str(base64.b64encode(bytes(strPassencoding=‘utf-8‘)) ‘utf-8‘)
timeData = {
相关资源
- 加州理工大学Python OpenGL教程
- 传智播客python基础班/就业班课件
- python人脸识别、人体识别、耳朵眼睛
- 算法基础第五版 Foundation Of Algorithms
- Python多线程
- python简略图书管理系统.doc
- ANSYS ACT二次开发.doc
- 请求分页存储管理(操作系统课设)
- Python Sample for Leap Motion
- python最佳实践指南--中文版
- Python植物大战僵尸.zip
- Python图像聚类
- python 简易发送邮件程序
- python turtle绘图
- 基于python的图书馆管理系统的改进
- python实现多项式加减乘除
- 贪吃蛇外加优化界面,质量保证pyth
- zw_基于python的网络爬虫设计.zip
- 简单的好友通讯录管理程序
- 将文件字母小写变大写并复制到其他
- Iterative Bagging和MultiBoosting 算法python实
- 租房API调用
- python 滑雪小游戏
- 5层神经网络带L2正则化的损失函数计
- 查找两幅图片中的不同
- python标准库中文版.tar
- python多人在线聊天室
- Python3 实现SM3国产哈希算法
- python爬取微博热搜并直接写入mysql.r
- Python-Scrapy 入门级爬虫项目实战
评论
共有 条评论