麻烦帮忙看下PHP的采集信息代码
想通过VIN码采集页面信息,但是返现post参数都提交过去后,页面却没有结果,麻烦帮我看下,是哪个参数写错了吗?还是?谢谢了
正常查询结果:
我的代码:
// 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;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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