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
3
votes
1 answer

Modifying navigator.webdriver flag to prevent Playwright detection

Selenium can use execute_cdp_cmd() to prevent navigator.webdriver. such as chrome.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument', { 'source': 'Object.defineProperty(navigator,"webdriver",{get: () => undefined})'}) So Playwright what method…
BugMaker
  • 61
  • 3
3
votes
1 answer

Playwright for Python: Leaving Tabs and Browser Windows Open After Testing

Open a new tab manually on a browser open by Playwright I am using Playwright for Python to open a browser, visit a URL and then do some action. Can I keep the browser's window open after my code runs? If I put a breakpoint in my Python code, I…
3
votes
3 answers

scrapy-playwright:- Downloader/handlers: scrapy.exceptions.NotSupported: AsyncioSelectorReactor

I tried to extract some data from dynamically loaded javascript website using scrapy-playwright but I stuck at the very beginning. From where I'm facing trubles in settings.py file is as follows: #playwright DOWNLOAD_HANDLERS = { "http":…
user17063618
3
votes
2 answers

Navigating to "url", waiting until "load" - Python Playwright Issue

Hey I have code in python playwright for getting page source: import json import sys import bs4 import urllib.parse from bs4 import BeautifulSoup server_proxy = urllib.parse.unquote(sys.argv[1]) link = urllib.parse.unquote(sys.argv[2]) from…
user16050795
3
votes
0 answers

Need to run Playwright Sync API inside Asyncio Loop

I am currently working on creating a Discord Bot using the Discord.py library. One of the tasks the bot has is to use other APIs to check for the latest Youtube Video, TikTok, etc. For parsing through the Tiktok content I am using the TikTokApi. I…
3
votes
1 answer

Python Playwright API get hrefs

I am trying to get all hrefs listed in a series of html element blocks. I don't know how to refer to the href as a selector, and I know the hrefs all begin with "/wiki/". I was wondering if there was a way to query the page for all hrefs that begin…
Tayne
  • 101
  • 3
  • 10
3
votes
1 answer

Simple way to add Firefox Extensions/Add Ons

I know with Pyppeteer (Puppeteer) or Selenium, I can simply add chrome/chromium extensions by including them in args like this: args=[ f'--disable-extensions-except={pathToExtension}', f'--load-extension={pathToExtension}' ] I also know…
BunnyHoppin
  • 39
  • 2
  • 5
3
votes
3 answers

How to keep browser opening by the end of the code running with playwright-python?

I want to use playwright-python to fill some forms automatically. And then double check the filling before submit. But it always close the browser by the end of the code running. Even if I used the handleSIGHUP=False, handleSIGINT=False,…
Kaol
  • 431
  • 2
  • 7
  • 16
3
votes
3 answers

How to handle multiple pages with playwright-python?

How to listen for new pages with playwright-python? In JavaScript it will be documented as: const playwright = require("playwright"); (async () => { const browser = await playwright.chromium.launch(); const context = await…
LeMoussel
  • 5,290
  • 12
  • 69
  • 122
2
votes
2 answers

Playwright install-deps fails in Dockerfile

I have a small application that uses playwright to scrape data from various websites. The application is Dockerized well and everything worked perfectly until I tried to re-build the Docker image (nothing really changed in the code) and it failed to…
2
votes
1 answer

Playwright NotImplementedError

I am running scrapy playwright on pycharm windows but i'm getting a Not ImplementedError. Here's the error; Traceback (most recent call last): File…
Daniel
  • 43
  • 5
2
votes
1 answer

Twitter login with Playwright

I'm new to Playwright, and I can't figure out how to get this working. I can enter my userID just fine, but then can't find the right code to click on the "Next" button. Here's one (of many) things I tried: from playwright_stealth import…
ViennaMike
  • 2,207
  • 1
  • 24
  • 38
2
votes
2 answers

Python playwright unable to access elements

I want to scrape the words which reside in the
  • elements. The results return an empty list. Are they resided within a frame because as I can see they are not within any