chyroc / WechatSogou

基于搜狗微信搜索的微信公众号爬虫接口
Apache License 2.0
5.9k stars 1.72k forks source link

最近公众号爬取的文章为空 article没有返回内容 #284

Open inspirationhyl opened 5 years ago

inspirationhyl commented 5 years ago

最近使用方法ws_api.get_gzh_article_by_history('南航青年志愿者') 获取任意公众号最近群发文章,返回结果皆为空。以“南航志愿者”为例,执行该方法后返回的内容为: {'gzh': {'wechat_name': '南航青年志愿者', 'wechat_id': 'nanhangqinggong', 'introduction': '南航大志愿活动的领跑者,为你 提供校内外的志愿资源和精彩消息。', 'authentication': '南京航空航天大学', 'headimage': 'http://wx.qlogo.cn/mmhead/Q3auHgzwzM4xV5PgPjK5XoPaaQoxnWJATnqibic3lN6efQvGzI0iaj7uQ/0'}, 'article': []}

inspirationhyl commented 5 years ago

有的时候还会报错: Traceback (most recent call last): File "", line 1, in File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\wechatsogou\api.py", line 446, in get_gzh_article_by_history identify_image_callback=identify_image_callback_weixin) File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\wechatsogou\api.py", line 116, in get_by_unlock resp = self.get(url, session, headers=self.__set_cookie(referer=referer)) File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\wechatsogou\api.py", line 65, in __get resp = session.get(url, headers=h, self.requests_kwargs) File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 546, in get return self.request('GET', url, kwargs) File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 519, in request prep = self.prepare_request(req) File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 462, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 313, in prepare self.prepare_url(url, params) File "C:\Users\ada\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 387, in prepare_url raise MissingSchema(error) requests.exceptions.MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant http://?

inspirationhyl commented 5 years ago

应该是因为搜狗增加了反爬取机制,原来的最近文章URL被隐藏

征集令

inspirationhyl commented 5 years ago

<a target="_blank" uigs="account_article_0" href="/link?url=dn9a_-gY295K0Rci_xozVXfdMkSQTLW6cwJThYulHEtVjXrGTiVgS-G7nWD3OUwP1082seqsC6HruDU1FvFnplqXa8Fplpd9WrUUt_p7PW89MXZ6dPPrLZBxu64_w8KqlWnLFD-98fqjjpaPFsPenEZ2N2s6dJvcGNcHmZCiFyqUk0DG_jEcKeNyJOWnJHWbILDabLZQsijSZvIPsRc6zE_ARy9r0WQvSpWs5vgoGX7DJUAlC_hYgAcbYgdQAbQZnKKq8DBaND6q3X8EKMKOIA..&amp;type=1&amp;query=%E4%BE%A0%E5%AE%A2%E5%B2%9B">征集令</a>

Warlock1994 commented 5 years ago

大佬,这个可以绕过去吗

inspirationhyl commented 5 years ago

大佬,这个可以绕过去吗

绕不过去 搜狗停用了这个服务了。最多只能看到最近一篇article了。

Warlock1994 commented 5 years ago

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

ldxbaby756 commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

anexplore commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

公众号平台,搜索文章?

Warlock1994 commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

公众号平台,搜索文章?

直接去爬传送门或者清博数据就行

Warlock1994 commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

直接去爬传送门或者清博数据就行,把文章地址获取到,后面都不用改

Alic-yuan commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

直接去爬传送门或者清博数据就行,把文章地址获取到,后面都不用改

大佬牛逼,传送门或者清博数据有反爬措施吗,会封ip吗

Warlock1994 commented 5 years ago

不知道,我反正没封

ldxbaby756 commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

直接去爬传送门或者清博数据就行,把文章地址获取到,后面都不用改

懂了,发现现在解决方案1就是爬公众平台,缺点是会有被封的风险, 2就是爬这种数据网站了,缺点是有的公众号他没有收录,或者数据更新没有那么及时。

ldxbaby756 commented 5 years ago

当然还有从移动端去入手,个人感觉这个成本较大

Alic-yuan commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

直接去爬传送门或者清博数据就行,把文章地址获取到,后面都不用改

懂了,发现现在解决方案1就是爬公众平台,缺点是会有被封的风险, 2就是爬这种数据网站了,缺点是有的公众号他没有收录,或者数据更新没有那么及时。

对的

Warlock1994 commented 5 years ago

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

直接去爬传送门或者清博数据就行,把文章地址获取到,后面都不用改

懂了,发现现在解决方案1就是爬公众平台,缺点是会有被封的风险, 2就是爬这种数据网站了,缺点是有的公众号他没有收录,或者数据更新没有那么及时。

对的,但是我感觉收录的还可以把,1的风险太大了

Alic-yuan commented 5 years ago

这个获取的文章链接是临时的还是永久的?

Warlock1994 commented 5 years ago

这个获取的文章链接是临时的还是永久的?

临时的吧,我看也是有时间戳的

Alic-yuan commented 5 years ago

有获得永久链接的思路吗

JeanRn commented 5 years ago

为什么老给我发啊 我不是管理员啊发自我的iPhone------------------ 原始邮件 ------------------发件人: Warlock notifications@github.com发送时间: 2019年8月13日 08:34收件人: Chyroc/WechatSogou WechatSogou@noreply.github.com抄送: Subscribed subscribed@noreply.github.com主题: 回复:[Chyroc/WechatSogou] 最近公众号爬取的文章为空 article没有返回内容 (#284)

请问大佬换了什么思路,能否分享一下

我反正换思路了,换了个地方抓取文章地址了,现在连验证码都不用了,反而方便了很多

公众号平台,搜索文章?

直接去爬传送门或者清博数据就行

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/Chyroc/WechatSogou/issues/284?email_source=notifications\u0026email_token=AMVFLY5QM7BFFVIIJHDMQHDQEH6Q7A5CNFSM4IJ3KC22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4EGO3A#issuecomment-520644460", "url": "https://github.com/Chyroc/WechatSogou/issues/284?email_source=notifications\u0026email_token=AMVFLY5QM7BFFVIIJHDMQHDQEH6Q7A5CNFSM4IJ3KC22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4EGO3A#issuecomment-520644460", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

simadi commented 4 years ago

传送门或者清博数据 的微信文章从哪儿来的呢?