python - Crawling WeChat public account articles requires entering verification code
过去多啦不再A梦
过去多啦不再A梦 2017-06-28 09:22:11
0
3
9640

The request is normal at first. If there are too many requests, this web page will be returned, prompting for verification.
Now that a proxy is added and a header is added, this is returned. I wonder if there is any way to bypass this verification, or can the verification be simulated in the background?
Has anyone encountered similar problems? Simply post the requested code

    url = "https://mp.weixin.qq.com/profile?src=3&timestamp=1498555925&ver=1&signature=mFCwcLO9hTwe*Js7TGQ457olpvr1d85gJSnVLyFgtYkX072FzolMsfonBR6Av2BOSe2kJ8z-m25ecftpvQ-edw=="
    req = urllib2.Request(url)
    proxy="218.56.132.155:8080"//尝试了各种代理ip,这边先写死
    opener = urllib2.build_opener(urllib2.ProxyHandler({'http':proxy}))
    urllib2.install_opener(opener)
    req.add_header("User-Agent", "Mozilla/5.0")
    req.add_header("Accept-Language", "zh-cn,zh;q=0.5")
    req.add_header('Accept-encoding', 'gzip,deflate')
    resp = urllib2.urlopen(req)
    content = resp.read()
    print content
过去多啦不再A梦
过去多啦不再A梦

reply all(2)
极世

Go to Sogou search and crawl WeChat

phpcn_u1582

I have never crawled through WeChat, but it is recommended to use requests. It is recommended to refer to wechatsogou

  • reply afdsaffffffffffffffffffffffffffffffffffff蓝色天空98
    蓝色天空98 author 2018-11-21 20:59:56
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template