playwright

Get tab name in Chrome with Playwright

Get tab name in Chrome with Playwright Question: I am trying to fetch the tab name with playwright, but my code only outputs the page url. For instance, I want to go to https://www.rottentomatoes.com/ and print the name being shown on the tab: Rotten Tomatoes: Movies/ Tv Shows/ Movie Trailers… I tried to use page.title …

Total answers: 2

Python Playwright start maximized window

Python Playwright start maximized window Question: I have a problem starting Playwright in Python maximized. I found some articles for other languages but doesn’t work in Python, also nothing is written about maximizing window in Python in the official documentation. I tried browser = p.chromium.launch(headless=False, args=["–start-maximized"]) And it starts maximized but then automatically restores back …

Total answers: 4

Gunicorn flask app can't download file using playwright on linux

Gunicorn flask app can't download file using playwright on linux Question: I’m making a ReST API using Flask and Playwright to download some files on a server. Locally, it works but, in server (Linux), returns a permission error. file = await self._loop.run_in_executor(None, lambda: open(path, "wb")) PermissionError: [Errno 13] Permission denied: ‘/var/apis/tceprotocolo/infos-(19).html’ local_save = ‘/var/apis/tceprotocolo’ def …

Total answers: 2

Playwright Python: Click Specific from Multiple Button

Playwright Python: Click Specific from Multiple Button Question: I want to Automate Fill Form using Playwright Python version. On Playwright NodeJS, I’ve been successfully to do the desired. Only when Porting the JS Script into Playwright Python API, it’s kinda different. The Web has Multiple Button (Submit and Random) with different Name. I can achieve …

Total answers: 1

Get element text behind shadow DOM element using Playwright

Get element text behind shadow DOM element using Playwright Question: I am trying to use Playwright to get contents of the open shadow root element which looks like this. <some-element> #shadow-root ABC </some-element> Here #shadow-root contains text ABC without any additional tags. I am able to locate some-element but I cannot find a way to …

Total answers: 2

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

Saving Login with Playwright

Saving Login with Playwright Question: I’m trying to save my login with playwright, I’ve read the documentation and tried to implement it into my code but I am still getting errors from playwright.sync_api import sync_playwright with sync_playwright() as p: browser = p.chromium.launch(headless=False, slow_mo=50) page = context.new_page() page.fill("input#input-username", "demo") page.fill("input#input-password", "demo") page.click("button[type=submit]") context = browser.new_context(storage_state="website1.json") storage …

Total answers: 1

Uploading an image to a website with Playwright

Uploading an image to a website with Playwright Question: I’m trying to click the button upload an image to this website: https://prnt.sc/ But it seems like there is not even a [button], so can I even click anything? Is this even possible? Super confused. There’s lots of documentation on how to do this with selenium, …

Total answers: 1

Is there a way to list all video URLs of YouTube search results in Python?

Is there a way to list all video URLs of YouTube search results in Python? Question: I’m using Playwright and BeautifulSoup, I can see important part of the URL (href="/watch?v=5iK4_44i8jU") but have not been able to list it, what am I missing? # pip install playwright # playwright install from playwright.sync_api import sync_playwright import regex …

Total answers: 1

Selecting from dropdown menu with Playwright in Python using attributes

Selecting from dropdown menu with Playwright in Python using attributes Question: With Playwright in Python I am trying to select from a variation dropdown on an Amazon product page -> https://www.amazon.de//dp/B08XWKDGL7 <select name="dropdown_selected_size_name" autocomplete="off" data-a-touch-header="Größe" id="native_dropdown_selected_size_name" tabindex="0" data-action="a-dropdown-select" class="a-native-dropdown a-declarative"> <option value="0,B08XWN4HM6" class="dropdownAvailable" data-a-css-class="dropdownAvailable" id="native_size_name_0" data-a-id="size_name_0" data-a-html-content="4,0 x 30 mm 500 Stück"> 4,0 x 30 …

Total answers: 2