CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/番外篇/常见反爬策略及应对方案.md
Views: 729
常见反爬策略及应对方案
构造合理的HTTP请求头。
Accept
User-Agent
Referer
Accept-Encoding
Accept-Language
检查网站生成的Cookie。
有用的插件:EditThisCookie
如何处理脚本动态生成的Cookie
抓取动态内容。
Selenium + WebDriver
Chrome / Firefox - Driver
限制爬取的速度。
处理表单中的隐藏域。
在读取到隐藏域之前不要提交表单
用RoboBrowser这样的工具辅助提交表单
处理表单中的验证码。
OCR(Tesseract) - 商业项目一般不考虑
专业识别平台 - 超级鹰 / 云打码
绕开“陷阱”。
网页上有诱使爬虫爬取的爬取的隐藏链接(陷阱或蜜罐)
通过Selenium+WebDriver+Chrome判断链接是否可见或在可视区域
隐藏身份。
代理服务 - 快代理 / 讯代理 / 芝麻代理 / 蘑菇代理 / 云代理
洋葱路由 - 国内需要翻墙才能使用