playwright-python

Handling pagination in python playwright when the url doesn't change

Handling pagination in python playwright when the url doesn't change Question: I am trying to scrape this site https://franchisedisclosure.gov.au/Register with playwright and the url doesn’t change after you click on the next button. How do I solve this pagination problem? Here’s my code ` from bs4 import BeautifulSoup as bs from playwright.sync_api import sync_playwright url …

Total answers: 1

SEC_ERROR_UNKNOWN_ISSUER, playwright python inside docker

SEC_ERROR_UNKNOWN_ISSUER, playwright python inside docker Question: My code is quite simple: from playwright.sync_api import sync_playwright pw = sync_playwright().start() firefox = pw.firefox.launch(headless=True) context=firefox.new_context() page= context.new_page() page.goto("http://www.uaf.cl/prensa/sanciones_new.aspx") Every single time I get a SEC_ERROR_UNKNOWN_ISSUER. Anyone know how I can bypass this? This is running inside a Docker container with update-ca-certificates. I’ve tried using the "ignore HTTPS errors" …

Total answers: 2

How to get a list of all links from a dynamic web page?

How to get a list of all links from a dynamic web page? Question: I’m trying to scrape this page: https://workspace.google.com/marketplace/search/word I tried PhantomJS+BeautifulSoup (failed), then Playwright to scrape the whole content of the page but I can’t see the links to the extensions. Do they get generated only when the cursor hovers over them? …

Total answers: 1

Why did a plawright-python app run in Docker failed? Headless=False?

Why did a plawright-python app run in Docker failed? Headless=False? Question: I have a small application that uses fast-api and playwright to scrape data and send it back to the client. The program is working properly when I’m running it locally, but when I try to run it as a Docker image it fails with …

Total answers: 2

How to type F5 to refresh a page using Playwright Python

How to type F5 to refresh a page using Playwright Python Question: I’m trying to refresh a webpage using F5 key. I know I can use: self.page.reload() But this is not a good solution for my problem. How to make the page to be refreshed using the F5 key? My code doesn’t refresh the page …

Total answers: 2

Using proxies with playwright in python

Using proxies with playwright in python Question: I’m using playwright to extract data from a website and I want to use proxies which I get from this website : https://www.proxy-list.download/HTTPS. It doesn’t work, and I’m wondering if this is because the proxies are free ? If this is the reason, can someone know where can …

Total answers: 1

Using Playwright with CSS that contains nth element

Using Playwright with CSS that contains nth element Question: I’m trying to find an element with a specific nth index as a CSS expression. How can I fix my code without changing the CSS expression? try: expect(self.page.locator(‘div[class="some-class"]:nth(3)’)). to_be_visible(timeout=20000) return True except AssertionError: return False The error I get is: {Error}DOMException: Failed to execute ‘querySelectorAll’ on …

Total answers: 2

Playwright does not load all of the HTML Python

Playwright does not load all of the HTML Python Question: I’m just trying to scrape the titles from the page, but the html that is being loaded with page.inner_html(‘body’) does not include all of the html. I think it may be loaded from JS, but when I look into the network tab in dev tools …

Total answers: 1

How to find partial text using Playwright

How to find partial text using Playwright Question: I’m using Playwright to write automated tests. My goal is to find an element by text contains and not by full match: myElement = self.page.locator(‘text="Some Text 123"’) I wish to find only the elements with the text 123, how to do that? Asked By: Tal Angel || …

Total answers: 2

Python doesn't wait for checkbox

Python doesn't wait for checkbox Question: Good afternoon. When in test you go to the site page, the next step is to uncheck the checkbox. But as soon as the page loads, the playwrite tries to immediately click (uncheck) the checkbox. Tell me how to tell the playwright to wait a while for the checkbox …

Total answers: 1