擅长:python、mysql、java
<p>隐藏cookie横幅的最简单方法是为了符合gdrp。当您接受cookie模式时,它会为您的系统在浏览器上编写一个cookie。在</p>
<p>像
<a href="https://i.stack.imgur.com/Z3pQj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z3pQj.png" alt="enter image description here"/></a></p>
<p>你也可以做同样的事。打开浏览器后,编写此cookie并重新加载浏览器。那么cookie模式将不会在功能中打开。在</p>
<pre><code>self.webdriver.add_cookie({'name' : 'notice_gdpr_prefs', 'value' : '0,1,2:', 'domain' : self.store['base'] + url})
self.webdriver.add_cookie({'name' : 'notice_preferences', 'value' : '2:', 'domain' : self.store['base'] + url})
</code></pre>
<p>我对python cookie不太了解写。你可以按照本教程编写cookie</p>
<p><a href="https://chercher.tech/python/python-selenium-cookies" rel="nofollow noreferrer">https://chercher.tech/python/python-selenium-cookies</a></p>
<p><a href="https://stackoverflow.com/questions/4349147/python-create-cookies-and-then-load-a-page-with-the-cookies">Python create cookies and then load a page with the cookies</a></p>