gospider007 / gospider

🚀Gospider is a powerful Golang web crawler that includes all the necessary libraries for transitioning from Python to Golang. It provides a fast and seamless transition for Python web crawlers to Golang.
GNU Lesser General Public License v3.0
91 stars 22 forks source link

不能在requests.ClientOption中设置Ja3Spec #6

Closed jianmaikj closed 11 months ago

jianmaikj commented 11 months ago

有时候需要动态Ja3,放在requests里面比较方便

gospider007 commented 11 months ago

之所以不放到requests 中是因为没有必要,如果放到requests 中,就会面临连接复用的问题,如果连接复用的话,那么在requests 中设置ja3将毫无意义。ja3的生效只会在tls 握手的时候才会产生,复用连接并不能保证这个连接的ja3和设置的ja3 相同。只有新建一个连接才能保证 设置的ja3 符合预期, 所以为了确保ja3的设置符合预期必须重新创建client ,故而没有必要在requests中设置ja3

gospider007 commented 11 months ago

requests.ClientOption 中设置ja3 应该参考文档 https://github.com/baixudong007/gospider/tree/master/requests#generate-fingerprint-from-string

jianmaikj commented 11 months ago

requests.ClientOption 中设置ja3 应该参考文档 https://github.com/baixudong007/gospider/tree/master/requests#generate-fingerprint-from-string

好的 谢谢!