Html cannot be captured, neither curl nor file_get_contents can be captured, but the page can be opened directly. Html cannot be captured, neither curl nor file_get_contents can be captured, but the page can be opened directly.
Consult
The URL is as follows:
Https:/count.taobao.com/counter3? Keys = SM_368_dsr-1097280647, iccp_rj522177046867 & callback = jsonp107
Why can't I catch any content? it's always empty.
Reply to discussion (solution)
Paste your code to see
$ch = curl_init();$url='https://count.taobao.com/counter3?keys=SM_368_dsr-1097280647,ICCP_1_522177046867&callback=jsonp107';curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);curl_setopt($ch, CURLOPT_HEADER, 0);$output = curl_exec($ch);curl_close($ch);echo $output;
Try setting CURLOPT_USERAGENT with the browser ID in curl.
$ch = curl_init();$url='https://count.taobao.com/counter3?keys=SM_368_dsr-1097280647,ICCP_1_522177046867&callback=jsonp107';curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);curl_setopt($ch, CURLOPT_HEADER, 0);$output = curl_exec($ch);curl_close($ch);echo $output;
How can I get this 4905? Thanks, online, etc. I will close the post immediately.
"Iccp_2017522177046867": 4905
He returns a function called by jsonp:
Jsonp107 ({"SM_368_dsr-1097280647": {v: 0, nv: 100, m_UFB: 0, m: 4.89661, m_g: 20.15, s_UFB: 0, s: 4.8744, s_g: 31.49, c_UFB: 0, c: 4.87867, c_g: 39.55, gp: 100.00, ss: 290159, hdr: true}, "iccp_417522177046867": 4914 });
Extract the content in the parentheses and use the json_decode function to decode them.
He returns a function called by jsonp:
Jsonp107 ({"SM_368_dsr-1097280647": {v: 0, nv: 100, m_UFB: 0, m: 4.89661, m_g: 20.15, s_UFB: 0, s: 4.8744, s_g: 31.49, c_UFB: 0, c: 4.87867, c_g: 39.55, gp: 100.00, ss: 290159, hdr: true}, "iccp_417522177046867": 4914 });
Extract the content in the parentheses and use the json_decode function to decode them.
$ Arr = json_decode ($ response, false );
Var_dump ($ arr );
Result $ arr is Null.
Take it for fun,
Update:
Dare not give a better name to the title of the question next time. you won't be able to pull the function.
Iccp_487522177046867;?>