> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.scrapingbee.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How can I bypass cookie consent page?

Most sites have cookie consent pop-ups, which can be closed via our API. We will use Google as an example, but you can apply the same logic to any website.

|| Keep in mind that every website is built differently, so cookie consent buttons are not standardized across sites. Each page may use its own unique layout, elements, or wording for cookie banners, which means the buttons must often be identified and handled on a case-by-case basis.

So to fix this issue and bypass it, we need to accept Google's terms, and we have two approaches to do that:

#### 1. Using a CONSENT Cookie:
Whenever you accept Google's terms, a cookie with the name **CONSENT** is saved on your computer. It usually contains a **YES+** text with a timestamp and the user's country code. So to mimic this behavior, we can visit the page we want to scrape with a cookie that contains a similar value:

```
from scrapingbee import ScrapingBeeClient
client = ScrapingBeeClient(api_key='API_KEY')

response = client.get(
'https://www.google.com/search?q=Best+Laptops+in+Europe&tbm=shop',
params={
'custom_google': 'true',
'stealth_proxy': 'true',
'country_code':'gb',
'wait': '1500' # Waiting for the content to load (1.5 seconds)
},
cookies= {'CONSENT': 'YES+'} # Sending a cookie with the request
)

if response.ok:
    print(response.content)
	# Do whatever you want with the request!
else:
    print(response.content)
```

#### 2. Using a JavaScript Scenario:
With this method, we mimic the exact behavior of a typical EU user: We click on the [I agree] button, and we continue our search!

```
from scrapingbee import ScrapingBeeClient
client = ScrapingBeeClient(api_key='API_KEY')

response = client.get(
'https://www.google.com/search?q=Best+Laptops+in+Europe&tbm=shop',
params={
'custom_google': 'true',
'stealth_proxy': 'true',
'country_code':'gb',
'js_scenario': {"instructions": [{"click": "form > div > div > button"}]}, # Clicking the agreement button
'wait': '1500' # Waiting for the content to load (1.5 seconds)
}
)

if response.ok:
    print(response.content)
	# Do whatever you want with the request!
else:
    print(response.content)
```