python - scrapy 在爬取携程时,被重定向到了一个有验证码的页面怎么办?
大家讲道理
大家讲道理 2017-04-18 10:11:24
0
2
585

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
巴扎黑

Reduce your crawl frequency, or use a multi-IP proxy.

左手右手慢动作

If the verification code is complicated, you can use the verification code recognition API provided by various coding platforms (charges may apply).
It is relatively simple to use the pytesseract library for identification (refer to https://www.waitalone.cn/pyth...).
The main idea is to download the verification code, pay attention to saving the cookie or session, then identify the verification code, and submit the result with the relevant cookie or session.
If you want to reduce the number of verifications, you can try changing the proxy IP, setting the crawler interval, changing the User-Agent, etc.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template