1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| $url = "https://investing.com/stock-screener/";
$parameters = "sp=country::22|sector::a|industry::a|equityType::a|exchange::9>eq_market_cap;1";
$cookie = tmpfile();
$userAgent = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.31' ;
$ch = curl_init("$url?$parameters");
$options = array(
CURLOPT_CONNECTTIMEOUT => 10 ,
CURLOPT_USERAGENT => $userAgent,
CURLOPT_AUTOREFERER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_COOKIEFILE => $cookie,
CURLOPT_COOKIEJAR => $cookie ,
CURLOPT_SSL_VERIFYPEER => 0 ,
CURLOPT_SSL_VERIFYHOST => 0);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
curl_close($ch);
print($result); |
Partager