zoukankan      html  css  js  c++  java
  • Content-Type: text/x-gwt-rpc; charset=UTF-8

    Content-Type: text/x-gwt-rpc; charset=UTF-8

    下载某个统计局网站,它的 Content-Type: text/x-gwt-rpc; charset=UTF-8

    请求方式是 post 请求 

    一言不合就上代码  

       url = 'http://data.ahtjj.gov.cn/bi/gwt/zbquery/zbquery'
         headers = {
    
            # "Host":"data.ahtjj.gov.cn",
            # "Connection":"keep-alive",
            # "Content-Length":"229",
            # "X-GWT-Module-Base":"http://data.ahtjj.gov.cn/bi/gwt/zbquery/",
            "X-GWT-Permutation":"5E9EB141DCF5CC57E7A3405E21549935",
            "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36",
            "Content-Type":"text/x-gwt-rpc; charset=UTF-8",
            # "Accept":"*/*",
            # "Origin":"http://data.ahtjj.gov.cn",
            # "Referer":"http://data.ahtjj.gov.cn/bi/zbquery/querymodel/querymodel.jsp?op=0&title=&id=Guid&onlyShowResult=false&schemeGuid=000001504639C3767B183BA575010B5F&function=1&windowId=015047581BC92300BC917A48BDF3322E_w129",
            # "Accept-Encoding":"gzip, deflate",
            # "Accept-Language":"zh-CN,zh;q=0.9",
            "Cookie":"JSESSIONID=B69622EB88A9A3E861C9BF5AC6485B12; clientlanguage=zh_CN; JSESSIONID=0794B111C9E5CBBD6B204A87FCF4B216",
    
        }
        data = '7|0|7|http://data.ahtjj.gov.cn/bi/gwt/zbquery/|6743B66F1ECCF1017396C8890D6319A5|com.jiuqi.bi.client.zbquery.querymodel.ZBQueryService|getChildren|java.lang.String/2004016611|com.jiuqi.bi.client.zbquery.common.enums.ImgType/3271576811|000001504639C3767B183BA575010B5F|1|2|3|4|2|5|6|7|6|3|'
        try:
            result = session.post(url=url,data=data,headers=headers).content
        except:
            result = session.post(url=url,data=data, headers=headers).content
    

      

  • 相关阅读:
    man date
    Python---Tkinter---贪吃蛇
    Python---TKinter项目实战---屏保
    虚拟化之kvm --(vnc控制台)
    cisco和华为的设备如何设置命令不分页显示
    liunx之Centos6.8杀毒软件的安装
    Liunx系统命令sed的使用
    自动运维之网络设备割接配置按预定步骤操作
    mutt+msmtp实现在shell环境中发送电子邮件
    windowns下excel2013快速生成月报表
  • 原文地址:https://www.cnblogs.com/xuchunlin/p/14121134.html
Copyright © 2011-2022 走看看