Giter VIP home page Giter VIP logo

Comments (5)

simoncos avatar simoncos commented on July 30, 2024 3

不知道具體怎麼改的,可以嘗試用我的版本直接替代你的auth.py: https://github.com/simoncos/zhihu-analysis-python/blob/master/crawler/auth.py

from zhihu-python.

tzhao0311 avatar tzhao0311 commented on July 30, 2024

请问楼上怎么加header,能说具体些吗?

from zhihu-python.

SUSHUO avatar SUSHUO commented on July 30, 2024

requests請求裏添加headers參數後錯誤變成正常的302跳轉請求,但是還是會提示驗證碼請求失敗啊

from zhihu-python.

Tassandar avatar Tassandar commented on July 30, 2024

把request定义的时候加上一段,伪装成正常的浏览器就好了。

fake_head= { 
'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36',

'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',

'Connection':'keep-alive' 
}
requests.headers = fake_head

from zhihu-python.

yujunhui avatar yujunhui commented on July 30, 2024

@SUSHUO
验证码请求失败的解决方法是一样的啊,在获取验证码那段代码的requests里面加多个headers

from zhihu-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.