Coder Social home page Coder Social logo

Comments (17)

fujq avatar fujq commented on August 23, 2024 2

向地址 http://weixin.sogou.com/antispider/thank.php 发post,会返回一个id的值,把这个值更新到cookies的SNUID里,就可以再次发送请求了。

from wechatsogou.

drugnotes avatar drugnotes commented on August 23, 2024

尝试在api,py文件里面加入代理IP和 headers 等信息,但是还是需要验证码。不知道搜狗微信弹出验证码的机制是什么?

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

@fujq 你好,能说说具体post里面需要什么内容吗?还是直接发个post请求就行了?想请教一下具体怎么做

from wechatsogou.

fujq avatar fujq commented on August 23, 2024

@yfhlearnios 在project里面的这个函数里面做的post就行

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

@fujq 好的,谢谢。我试一下

from wechatsogou.

fujq avatar fujq commented on August 23, 2024

@yfhlearnios 哦对 Referer在我抓的包里面不是照他那样写的,我改成了'Referer': 'http://weixin.sogou.com/antispider/?from=%2f' + quote(_vcode_url.replace('http://weixin.sogou.com/', ''))

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

@fujq 嗯嗯,好的

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

@fujq 你好,验证码的处理你是怎么做了?用那个打码平台还是自己做的?我这个自己也写了个搜狗爬虫的程序,就是现在遇到了验证码的问题。到时候要把程序放在centos的服务器上运行,想看看有没有什么能够程序自己处理验证码的方法。

from wechatsogou.

fujq avatar fujq commented on August 23, 2024

@yfhlearnios 我自己手动输入的,你要放到centos上的话可以参考下这个网址,不然就只能找代理了吧

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

@fujq 嗯嗯,感谢

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

@fujq 你好,我现在是在获得微信公众号链接,进入公众号文章列表界面的时候遇到了验证码,按照项目里的方式,结果服务器给我返回的状态码是501,不识别我发送的数据,这个可能是怎么造成的?你遇到过列表界面处理验证码的问题吗?

from wechatsogou.

fujq avatar fujq commented on August 23, 2024

@yfhlearnios 我只是用到搜索微信文章的列表,没试过公众号列表,不过我猜搜狗所有的验证码处理都是一样的?501我没遇到过,是不是你发的不是post?还是你post的内容不对?你可以对照用浏览器抓包然后模仿浏览器发请求试一下。

from wechatsogou.

yfhlearnios avatar yfhlearnios commented on August 23, 2024

 @fujq 好的,谢谢

from wechatsogou.

tommyyz avatar tommyyz commented on August 23, 2024

@fujq

向地址 http://weixin.sogou.com/antispider/thank.php 发post,会返回一个id的值,把这个值更新到cookies的SNUID里,就可以再次发送请求了。

You saved my day.

补充一下,这个页面会返回一个json,其中有一个id的值,然后手动把这个id储存在self._session里即可。

snuid = json.loads(rr.text).get('id')
self._session.cookies.set('SNUID', snuid)

另外,我在对比浏览器请求时还发现一个cookie叫SUV需要获取,获取方式为调用http://pb.sogou.com/***.gif地址。必须在所有请求之前调用:

url_gif = 'http://pb.sogou.com/pv.gif?uigs_productid=webapp&type=antispider&subtype=close_refresh&domain=weixin&suv=&snuid=&t=' + str(int(time.time()))
self._session.get(url_gif)  # 获取SUV并存入session

你以为你伪装成gif我就认不出你了吗!

from wechatsogou.

fujq avatar fujq commented on August 23, 2024

@tomzhu6066 我没有请求过http://pb.sogou.com/cl.gif,只是每次发请求都把response的cookie更新到我自己的session里,在发http://weixin.sogou.com/antispider/thank.php 的post后SNUID要特别更新一下。

from wechatsogou.

tommyyz avatar tommyyz commented on August 23, 2024

@fujq 如果原库一切正常可以不调那个gif地址,我是有报错才加的,也有可能是代码改的多了。

from wechatsogou.

chyroc avatar chyroc commented on August 23, 2024

#92

from wechatsogou.

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.