<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emmanuel David</title>
    <description>The latest articles on DEV Community by Emmanuel David (@worldtok4u).</description>
    <link>https://dev.to/worldtok4u</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F126903%2F455d25ee-f63b-419a-9617-3847efcec20c.png</url>
      <title>DEV Community: Emmanuel David</title>
      <link>https://dev.to/worldtok4u</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/worldtok4u"/>
    <language>en</language>
    <item>
      <title>How to authenticate with cookie and curl to scrape a laravel-built website</title>
      <dc:creator>Emmanuel David</dc:creator>
      <pubDate>Fri, 27 Jan 2023 17:17:02 +0000</pubDate>
      <link>https://dev.to/worldtok4u/how-to-authenticate-with-cookie-and-curl-to-scrape-a-laravel-built-website-5f1e</link>
      <guid>https://dev.to/worldtok4u/how-to-authenticate-with-cookie-and-curl-to-scrape-a-laravel-built-website-5f1e</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/75260405/how-to-authenticate-with-cookie-and-curl-to-scrape-a-laravel-built-website" rel="noopener noreferrer"&gt;
            How to authenticate with cookie and curl to scrape a laravel-built website
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Jan 27 '23&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/75260405/how-to-authenticate-with-cookie-and-curl-to-scrape-a-laravel-built-website" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;pre class="lang-php prettyprint-override"&gt;&lt;code&gt;
$url = 'https://example-built-with-laravel.com/dashboard'
$userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36";

$ch = curl_init();

$ckfile = 'cookies.txt';

curl_setopt_array($ch, [
    CURLOPT_URL =&amp;gt; $url,
    CURLOPT_RETURNTRANSFER =&amp;gt; true,
    CURLOPT_CUSTOMREQUEST =&amp;gt; "GET",
    CURLOPT_MAXREDIRS =&amp;gt; 10,
    CURLOPT_SSL_VERIFYPEER =&amp;gt; false,
    CURLOPT_TIMEOUT =&amp;gt; 0,
    CURLOPT_FOLLOWLOCATION =&amp;gt; true,
    CURLOPT_USERAGENT =&amp;gt; $userAgent,
    CURLOPT_COOKIESESSION&lt;/code&gt;&lt;/pre&gt;…
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/75260405/how-to-authenticate-with-cookie-and-curl-to-scrape-a-laravel-built-website" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
