search

Home  >  Q&A  >  body text

python - Crawling WeChat public account articles requires entering verification code

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梦2732 days ago9637

reply all(3)I'll reply

  • 极世

    极世2018-07-06 18:29:52

    Go to Sogou search and crawl WeChat

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-06-28 09:24:11

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

    reply
    0
  • 蓝色天空98

    afdsaffffffffffffffffffffffffffffffffffff蓝色天空98

    蓝色天空98 · 2018-11-21 20:59:56
  • Cancelreply