$ch = curl_init(); // Initialising cURL session
// Setting cURL options
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // Prevent cURL from verifying SSL certificate
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); // method
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE); // Script should fail silently on error
// curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE); // Use cookies
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); // Follow Location: headers
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Returning transfer as a string
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("X-Requested-With: XMLHttpRequest", "Content-Type: text/html; charset=UTF-8")); // Setting URL to POST to
curl_setopt($ch, CURLOPT_POST, TRUE); // Setting method as POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); // Setting POST fields as array
$results = curl_exec($ch); // Executing cURL session
curl_close($ch); // Closing cURL session
return $results;
}
$url = 'https://www.ottawatourism.ca/events/'; // Login POST URL
// Array built from login credentials
$credentials = array(
'action' => 'events_see_more', // Your email address
'security' => 'a5db027292', // Your password
'page' => '5'
);
$request = curlPost($url, $credentials);
var_dump($request);
برچسب : how to scrape a website,how to scrape paint,how to scrape a bowl,how to scrape popcorn ceiling,how to scrape vanilla bean,how to scrape resin,how to scrape a pipe,how to scrape paint off a house,how to scrape tongue,how to scrape a website python, نویسنده : استخدام کار phpco بازدید : 149