search

Home  >  Q&A  >  body text

python - scrapy 在爬取携程时,被重定向到了一个有验证码的页面怎么办?

大家讲道理大家讲道理2948 days ago586

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:13:24

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

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:13:24

    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.

    reply
    0
  • Cancelreply