I try to write test for site that has cloudFlare. enter image description here I want to put in conftest.py @fixture for creating context that will be used for all tests. Also I want to use "playwright codegen", now it is not possible because I couldn't pass cloudflare test.
I try with proxy, but doesn't find workable free version. So I try with ZenRows. Can you help me to make this code workable for fixture, and advice me how to use codegen now.
@pytest.fixture()
def context_zenrow(playwright: Playwright) -> None:
browser = playwright.chromium.launch(headless=False)
context = browser.new_context()
page = context.new_page()
page.goto("https://bksks.bg")
# how to put follow code form zenrows to get successfully site displaied:
client = ZenRowsClient("047046cf0a881b96afd26cef5d0c7aa9e97e9789")
url = "https://bksks.bg/"
response = client.get(url)
#
yield page