Questions tagged [playwright-python]

Microsoft Playwright is a web automation library comparable to Selenium. This tag refers to the Python port of the library.

Microsoft Playwright is a web automation library comparable to Selenium. Originally a Javascript project, this is now also available in Python.

Related tags:

365 questions
0
votes
1 answer

how do I select element in nest html by playwright

I want to extract text from the html below,I tried different way to do, but it still fail.page_id、article_id is random.I want to get a list of text. html:
0
votes
0 answers

Function testing with playwright and python

I'm kinda new in coding and was asked to do a test for the company web login, they want me to implement the module unitestt and playwright test generator tool. This is what I have so far. I had to separate run from test_1 since unittest failed while…
0
votes
3 answers

Python playwright: wait for arbitrary DOM state

I've been tooling around with Playwright on Python (v1.16) and thought I'd migrate some of our Cypress tests as an experiment. However, I've run into several snags all related to the same problem: I need to wait for some arbitrary DOM state and…
user2859458
  • 2,285
  • 1
  • 17
  • 27
0
votes
2 answers

Is there any way to close popup while running headless chromium?

I am using the Playwright library to get data from a website. The issue is that website shows a popup when it open which results in stuck processes since the program is not able to get any button due to the popup. Is there any way to close a popup…
bSr
  • 1,410
  • 3
  • 16
  • 30
0
votes
1 answer

Parsing section of website with playwright or requests

Trying to parse section of Coinbase blog website https://blog.coinbase.com/, that one under 9 first posts, starting with
to get the latest news (not sure…
0
votes
1 answer

Cannot webscrape elements with Playwright and BeautifulSoup

I am trying to update my webscraping scripts as the site (https://covid19.gov.vn/) have updated but I can't for my life found out how to parse these elements. Inspecting the elements it seems like it is there as usual but I cannot parse it with…
0
votes
1 answer

Playwright on Azure Functions Python based

I am trying to scrape a website using playwright and host it on Azure Functions. However, playwright requires Chrome drivers which I can't seem to install into Azure Functions. Unsure how to do this step in a pipeline: pip install…
Tujamo
  • 93
  • 8
0
votes
1 answer

playwright._impl._api_types.Error: Evaluation failed: cyclic object value when retriving dataLayer variable - Playwright-Python

I'm using playwright with Python. I'm trying retrieve the datalayer from a page with page.evaluate() from playwright . The error i get : playwright._impl._api_types.Error: Evaluation failed: cyclic object My code : datalayer = page.evaluate('''() =>…
0
votes
1 answer

How to create standalone Python Playwright project?

I'm looking into creating a standalone Python Playwright project, but when I follow the Python Playwright installation steps mentioned here, everything gets installed in various places on my PC. Is there a way of installing this in a preferred…
0
votes
1 answer

Receiving response from python as an array - PHP

I have PHP code, and I'm calling python script which takes the URL, go the web URL, takes the JSON page and then send back JSON page to the PHP code, but the issue is that i got that JSON in the array and not in the correct JSON format, anu…
user15647143
0
votes
1 answer

How to interact with Iframes using Xpath in Playwright

I'm trying to switch to an iframe so then I can fill a box. The iframe has a dynamic id so I cannot use that, it has a class and a title which I have converted into an XPath. However, I do not seem to get an error when switching to iframe but when…
CheemaOTB
  • 39
  • 1
  • 3
0
votes
1 answer

playwright python cant get the api pages using cookies

I have two scripts in python: login >> go to the website, login using login form and store the cookies into JSON file for later use import json from playwright.sync_api import sync_playwright with sync_playwright() as p: browser =…
user15647143
0
votes
1 answer

python playwright - issue with adding cookies from file

I have cookies.json file where I stored cookies after login. I created the script to open page using that cookies, this is the code: import json from playwright.sync_api import sync_playwright with sync_playwright() as p: browser =…
user15647143
0
votes
1 answer

Use another URI or route for requests in Playwright

Below is my code. When the application is served and the tests start it uses the BASE_URL I pass in await page.goto(BASE_URL). I want to use another route for all my requests. describe("Screenshots - PLAYWRIGHT", () => { it("Takes screenshots for…
0
votes
1 answer

How to run python playwright on Azure Cloud using Python

I'm trying to deploy timer trigger function that extracts data from web. I'm using playwright to access. My code runs as expected on my local machine. However when I tried to deploy on cloud it says: Result: Failure Exception: Exception:…