简体   繁体   English

网址未使用php curl

[英]Url not using php curl

I am trying to open a https url but it is not working.It works for other https websites but for this it is not working.I don't know the reason why it is happening like that.Below is the code i have written. 我正在尝试打开一个https URL,但它不起作用。它可用于其他https网站,但为此它不起作用。我不知道它为什么会这样发生。 Please help. 请帮忙。

<?php
 error_reporting(E_ALL);
 $url = "https://sgate.bmwgroup.com/login_common.fcc";
 $ch = curl_init($url);
 curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 200);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
 curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,1);
 curl_setopt($ch, CURLOPT_SSLVERSION, 3);
 curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
 curl_setopt ( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2)          Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)" );
  $curl_scraped_page= curl_exec($ch);
  if(!$curl_scraped_page)
{
echo "first learn";
}
if(curl_errno($ch)) {
 echo 'Curl error: ' . curl_error($ch);
 }
 echo $curl_scraped_page;
 curl_close($ch);
 ?>    

good news that page is working, bad news that site is using javascript, and while he doesn't get his scripts, the page is not showing. 该页面正在运行的好消息,该网站正在使用javascript的坏消息,而他没有获得脚本的页面却没有显示。 instead of echo $curl_scraped_page; 而不是echo $curl_scraped_page; try to use: 尝试使用:

var_dump(htmlspecialchars($curl_scraped_page));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM