<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Navigare sito con cURL, mi restituisce errore]]></title><description><![CDATA[<p dir="auto">Buongiorno!<br />
Vorrei navigare su Facebook senza aprire un Browser, cioè:<br />
lanciando uno script php tramite curl vorrei fare l'autenticazione e poi andare su altre pagine.</p>
<p dir="auto">Ho trovato questo esempio per il "Primo Step" cioè l'autenticazione:</p>
<pre><code>$fields = array(
                'email' =&gt; '---email-fb---',
                'pass'  =&gt; '---password-fb---'
                );

$cookies = 'cookies.txt';

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://m.facebook.com/login');
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'MozillaXYZ/1.0 Finto User-Agent');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($ch);

curl_close($ch);

echo $output;
</code></pre>
<p dir="auto">ma restituisce questo errore:</p>
<pre><code>HTTP/2 302 pragma: no-cache location: https://m.facebook.com/checkpoint/?checkpoint_data=%7B%22u%22%3A100027601590243%2C%22t%22%3A1607594565%2C%22step%22%3A0%2C%22n%22%3A%224Pu9JWhqzNo%3D%22%2C%22inst%22%3A714186469511400%2C%22f%22%3A207799259245384%2C%22st%22%3A%22p%22%2C%22aid%22%3Anull%2C%22ca%22%3Anull%2C%22la%22%3A%22%22%2C%22ta%22%3A%221607594568.ch.s%3Apw.tDBEAiBEi0AM7VM7jTQ_g5v20Fo3VwS7PYHetaWOSC68QbR71wIgeERxwNuDfxU_xLUaYPnhqfPr8gzv7w1IGREOsM9qVWM%22%2C%22sat%22%3Anull%2C%22s%22%3A%22AWV8DrJ4ZuVenjKFXiU%22%2C%22cs%22%3A%5B%5D%2C%22lds%22%3Atrue%7D&amp;_rdr cache-control: private, no-cache, no-store, must-revalidate expires: Sat, 01 Jan 2000 00:00:00 GMT set-cookie: locale=it_IT; expires=Thu, 17-Dec-2020 10:02:45 GMT; Max-Age=604800; path=/; domain=.facebook.com; secure strict-transport-security: max-age=15552000; preload; includeSubDomains x-content-type-options: nosniff content-type: text/html; charset=utf-8 x-xss-protection: 0 x-frame-options: DENY x-fb-debug: ECJt6w+a27vxNBskmhhsAliDr3Q9Wq9fVeo6XH9fDsJy5MpS2/ERQUnw3ZGvRRXrOU0bb/8PH7Ddui0CcmEApw== content-length: 0 date: Thu, 10 Dec 2020 10:02:48 GMT alt-svc: h3-29=":443"; ma=3600,h3-27=":443"; ma=3600
</code></pre>
<p dir="auto">Avete un idea del motivo?</p>
]]></description><link>https://dev.connect.gt/topic/244105/navigare-sito-con-curl-mi-restituisce-errore</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 19:48:41 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/244105.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Dec 2020 10:16:03 GMT</pubDate><ttl>60</ttl></channel></rss>