zoukankan      html  css  js  c++  java
  • 高考成绩查询接口(转)

    来自: http://www.oschina.net/code/snippet_205431_11454

    header
    ('Content-type:text/html;charset=utf-8'); //抓取河南省高考成绩 require './simple_html_dom.php'; //require './Snoopy.class.php'; $ch = curl_init(); $url = 'http://www.heao.gov.cn/PZQuery/PZCJQuery.aspx'; //数据 $arr = array( 'KSH'=>'12345678901234', 'BMXH'=>'123456789012', 'SFZH'=>'420107199007071510', ); $headers = array( 'User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36', 'Referer:http://www.haedu.gov.cn/hadoe_plus/gk_cx/query_iframe.aspx', ); /* $snoopy = new Snoopy ; $snoopy->agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36"; $snoopy->referer = "http://www.haedu.gov.cn/hadoe_plus/gk_cx/query_iframe.aspx" ; $action = "http://www.heao.gov.cn/PZQuery/PZCJQuery.aspx"; $snoopy->submit($action,$arr); $dom = str_get_html( $snoopy->results ) ; echo $dom; */ curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER,$headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arr)); $data = curl_exec($ch); curl_close($ch); $dom = str_get_html( $data ); $a = $dom->find( 'div.result span#ErrorMSG' ); if(count( $a ) == 1){ echo $a[0]->text(); }
  • 相关阅读:
    Centos 7.9 部署可道云
    shell简单检查URL
    TIME_WAIT和CLOSE_WAIT状态过多的分析与解决
    win10 关闭自动更新
    Python3 按backspace问题 ^H
    CentOS7设置笔记本合盖不休眠
    centos7 /boot/分区处理
    if __name__ == '__main__'
    在Linux中了解TCP包装器(/etc/hosts.allow&/etc/hosts.deny)
    华为路由器端口映射
  • 原文地址:https://www.cnblogs.com/loveyouyou616/p/3544546.html
Copyright © 2011-2022 走看看