import asyncio
import re
from playwright.async_api import async_playwright, Playwright, expect
async def geochange(playwright: Playwright):
chromium = playwright.chromium
browser = await chromium.launch()
context = await browser.new_context()
page = await context.new_page()
await page.goto("https://google.com")
await page.locator(".popup__close").click()
geo_cookies = await page.context.cookies()
print(geo_cookies)
I have the codeblock, and I need to get specific cookie, but no idea what I need to put in url at await page.context.cookies().
When I run this block I get full cookies, but I need only “lim” from this part:
{'name': 'siteCityCode', 'value': 'lim'....
New contributor
Andrey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.