麻烦帮忙看下PHP的采集信息代码

想通过VIN码采集页面信息,但是返现post参数都提交过去后,页面却没有结果,麻烦帮我看下,是哪个参数写错了吗?还是?谢谢了

正常查询结果:

clipboard.png

clipboard.png

我的代码:

// Vin 码参数
        $query_info = array(
            'leftvin' => 'LSGAR5AL',
            'textfield3' => '',
            'rightvin' => 'HH133445',
            'x' => 69,
            'y' => 31
        );
        // 参数上下文
        $context = stream_context_create(array(
            'http' => array(
                'method'  => 'POST',
                'header'  => "Content-type: application/x-www-form-urlencoded",
                'content' => http_build_query($query_info),
                'timeout' => 20
            )
        ));
        // 抓取页面第一层网址
        $url = "http://www.chinacar.com.cn/vin_index.html";
        // 开始抓取
        $content = file_get_contents($url, false, $context);
        var_dump($content);die;
阅读 3k
1 个回答

http请求的话,用curl
另外post参数都传了,你可能没有放相应的cookie(登录信息)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题