<p dir="auto">Hello !<br>
I want to make a automatic screenshot program but I have a annoying EU cookie popup on my screenshot. How i can remove these in Playwright ?</p>
<p dir="auto">I try this solution but it don't work T_T</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const browser = await playwright.firefox.launch({
   headless: true,
   firefoxUserPrefs: {
    &quot;network.cookie.cookieBehavior&quot;: 2
   }
});"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</span><span class="pl-kos">.</span><span class="pl-c1">firefox</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
   <span class="pl-c1">headless</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
   <span class="pl-c1">firefoxUserPrefs</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"network.cookie.cookieBehavior"</span>: <span class="pl-c1">2</span>
   <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Thank !</p>
<p dir="auto">0</p>
<p dir="auto">I am working on project where i am taking the screenshot of various web pages. i have used the playwright nodejs package to take screenshot. when i navigate to the required url. web page loaded along with dialog box of accepting cookies in centre . I want to accept the cookies than takes screenshot.</p>