playwright

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

how to add playwright docker image to docker compose?

how to add playwright docker image to docker compose? Question: I am building Django app where I want to run Django and playwright images in 1 container in Docker Desktop (locally). Below you can see my docker-compose.yml file: version: ‘3.8’ services: web: build: ./docker_playwright_test command: python manage.py runserver 0.0.0.0:8000 volumes: – ./docker_playwright_test/:/usr/src/docker_playwright_test/ ports: – 8000:8000 …

Total answers: 2

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

Changing pickup and dropoff dates in turo using playwright

Changing pickup and dropoff dates in turo using playwright Question: Hi I’m trying to scrape some data from this site https://turo.com/us/en/car-rental/united-states/austin-tx/tesla/model-s/1733237?endDate=11%2F09%2F2022&endTime=11%3A00&startDate=11%2F05%2F2022&startTime=11%3A00 using playwright but I’m struggling with changing the date and time. At first I tried to make my bot click on the date and time boxes but I kept running into issues so I …

Total answers: 1

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