反反爬虫
来时春尽
这个作者很懒,什么都没留下…
展开
-
2信息校验型反爬虫之Cookie反爬虫
测试网站首页 测试网站爬取信息的子页面 直接请求子页面(带UA) import requests # from parsel url = 'http://www.porters.vip/verify/cookie/content.html' headers = { 'user-agent': 'PostmanRuntime/7.26.8' } response = requests.get(url=url, headers=headers) # 403服务器已收到请求但是拒绝执行 # 404相应资原创 2020-12-15 21:55:17 · 285 阅读 · 0 评论 -
1信息校验型反爬虫之User-Agent
测试网址 爬取页面范围:首页 爬取信息:标题、正文、时间 F12刷新查看请求类型:get请求且没有传递参数 编写请求 import requests # from parsel url = 'http://www.porters.vip/verify/uas/index.html' response = requests.get(url=url) # 403服务器已收到请求但是拒绝执行 # 404相应资源不存在 # 200服务器已经成功处理了请求 print(response.status_code)原创 2020-12-15 18:31:22 · 534 阅读 · 0 评论