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
2 answers

Playwright Python: Click random list item from unordered list dropdown

I am trying to store a variable of list items from a dropdown on my company's web app. I am writing an automation test that will randomly click on one of the 40 possible list items in this drop down. Is this something that is possible with…
0
votes
1 answer

Using playwright for Python, how do I wait for two different selectors/handles at the same time and take the first successful match?

using Playwright for Python, I need to catch if a page displays a winner or a loser message. I can wait for a winner message to appear like this: new_selector = "text=Your are a winner" page.wait_for_selector(new_selector) handle =…
576i
  • 7,579
  • 12
  • 55
  • 92
0
votes
1 answer

Website Access Denied in My RPA Python/Playwright

I'm doing an RPA in Python and I'm having a problem trying to access this site: My code: browser = await playwright.chromium.launch(channel='msedge', headless=False, args=['--start-maximized'], slow_mo=1000) #headless=False,…
user19016544
0
votes
1 answer

Evaluate before frame renders on playwright

I have a series of async page.evaluate() functions that I want to run before each page starts executing its own javascript. The page class provides something similar to inject a javascript file to each page / before before the client code is…
individualtermite
  • 3,615
  • 16
  • 49
  • 78
0
votes
1 answer

Can you extend Playwright Page() Python sync?

I'm testing out Playwright (Python) and there are a bunch of additional methods that I want to attach to the Page(). I tried inheriting the class but keep getting _init__() missing 1 required positional argument: 'impl_obj' What is this impl_obj and…
0
votes
2 answers

scrapy-playwright: Why "waiting for selector to be visible" error is showing?

I am trying to automatically select values using playwright. But it is not selecting the values. waiting for selector "(//option[@value='2000000'])[2]" to be visible this error message is showing. What is the reason behind it? def…
Raisul Islam
  • 277
  • 2
  • 19
0
votes
1 answer

How to set headless = Flase in scrapy-playwright?

In scrapy-playwright, how to set "headless = False". I am trying something like this. def start_requests(self): yield scrapy.Request( url=url, callback = self.parse, meta= dict( …
Raisul Islam
  • 277
  • 2
  • 19
0
votes
1 answer

Playwright Python - Tab Link Not Visible

I am trying to hover the Mouse Pointer over the Tab Link "Markets". But inside Playwright it states the element is not visible. I have tried to use page.wait_for_selector, but i get the same type of response. I have tried multiple ways in using the…
Calculate
  • 329
  • 1
  • 5
  • 19
0
votes
1 answer

Python Playwright's async does not process all of the scraped pages

Scraping and parsing Javascript pages in Playwright. There are about 100 URLs, but the process ends without completing all of them. What could be the cause of this? The code is working so far. Is the for syntax in the wrong place? I would appreciate…
0
votes
1 answer

scrapy-playwright returning nothing but an error

I'm learning Scrapy-playwright and it's fighting me. I'm attempting to gather store locations from a site using the CrawlSpider with a rule including a process_request that triggers the request to run through playwright. In my callback def I can…
CwnAnnwn
  • 13
  • 1
  • 4
0
votes
2 answers

playwright python iterating through HTML table

Currently working with data in a HTML table on a webpage that looks like this: I have the following python code using playwright: from config import CLINK_ID, CSA_PWD, MY_URL from playwright.sync_api import sync_playwright import time with…
punkuotukas
  • 77
  • 2
  • 10
0
votes
0 answers

Scrapy Playwright AttributeError: 'ScrapyPlaywrightDownloadHandler' object has no attribute 'contexts'

import scrapy from scrapy_playwright.page import PageCoroutine from scrapy.crawler import CrawlerProcess import asyncio asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) class NewsSpider(scrapy.Spider): name = "news" …
0
votes
1 answer

Download currnet image with python playwright

Is it possible to make something like this with Playwright: https://stackoverflow.com/a/52692041 import base64 img_base64 = browser.execute_script(""" var ele = arguments[0]; var cnv = document.createElement('canvas'); cnv.width =…
Nisse Karlsson
  • 139
  • 2
  • 15
0
votes
0 answers

Understand the With-As commands when starting the Playwright

I'm trying to integrate Playwright and RobotFW together after spending years working with Selenium + RobotFW. My test case is very simple: TEST_1 Check correctness of showing Login screen [Tags] ui automated Go to login screen…