zoukankan      html  css  js  c++  java
  • 微信

    import requests
    from lxml import etree
    # User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
    
    def body():
        url = "https://mp.weixin.qq.com/s/zxvlP6xrMty_PKhuRYVeHA"
        header = {'User-Agent':'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36'}
        respones = requests.get(url,headers=header)
        # print(respones)
        respones.encoding = "utf_8"
        html = respones.text
        obj = etree.HTML(html)
        obj_2 = obj.xpath('//div[@class="rich_media_content "]/p/img/@data-src')
        print(obj_2)
        for i in obj_2:
            r = requests.get(i)
            with open(r"F:day08人民日报微信图片\%s.doc"%i[-30:-20],"wb") as f:
                f.write(r.content)
    body()
    

      

  • 相关阅读:
    tablespaces
    转 房价
    Duplicate a whole line in Vim
    Dubbo+JStorm
    replace all
    ORACLE 最后表数据更新的时间
    list reverse
    python IDE
    string 方法
    java JIT AOT
  • 原文地址:https://www.cnblogs.com/heluobing/p/10872650.html
Copyright © 2011-2022 走看看