560 questions
0
votes
1
answer
371
views
Unable to run Playwright test scripts in debug Mode
I'm trying to learn Playwright, so I was checking Playwright Inspector concept and written below piece of code. In Pycharm terminal I run the below i.e. set PWDEBUG=1 and use pytest
PWDEBUG=1 pytest -...
1
vote
1
answer
418
views
v2 reCaptcha from Playwright-recaptch is inconsistent
We use enterprise anchor google image reCaptcha in our website and while automating it with our test framework(playwright and python) with this plugin, for the first few runs it's working but then ...
0
votes
0
answers
100
views
'Browser' object has no attribute 'get_playwright_browser'
Am trying to develop a code that uses browser-use and playwright to open a website, and apply on jobs. I have automated the login and search and only want AI to kick in when the code has searched the ...
1
vote
0
answers
183
views
Playwright Launch Persistent Context doesn't work in Docker
Background:
I have a chromium user-data folder which contains a logged-in Instagram account. I want playwright to launch using persistent context from the user-data folder, open Instagram, and take a ...
1
vote
0
answers
51
views
How to pass parametrize values as well as APIcontext with in test so the I get separate result
I am trying to play around playwright/Pytest API testing.
I need to read data from xlsx file and returning dictionary in the form for TC_NAME,BODY,Result.
I have used Custom decorator method to make ...
-1
votes
1
answer
240
views
Playwright getting different results if in headless mode (Error 405 banned) [duplicate]
#!/usr/bin/env python3
from playwright.sync_api import sync_playwright
from bs4 import BeautifulSoup
import json
from pathlib import Path
def scrape_urlhaus():
with sync_playwright() as p:
...
0
votes
1
answer
713
views
Issue with downloading file via Browser-use
I am writing web automation to download a file by browser-use web automation tool that uses LLM as an AI Agent. The download files feature isn't supported by the Browser-use as a built-in ...
0
votes
0
answers
141
views
Getting [WinError 5] Access is denied error while using browser-use agent in python
I am using a test script given in browser-use examples, but currently I am getting following error from browser-use agent: '[WinError 5] Access is denied'. My code looks like this:
import csv
import ...
2
votes
3
answers
187
views
Getting a blank output while using scrapy playwright
I tried using scrapy playwright to scrape few contents from this website: https://www.scrapethissite.com/pages/ajax-javascript/.
I have added the html code which I was trying to scrape:
html code
I ...
1
vote
1
answer
1k
views
How to load and use an extension within Browser-use?
I'm using browser-use for web automation. This package uses playwright under the hood. I realized it is not possible to load an extension in incognito mode, so I must use playwright.chromium....
2
votes
1
answer
75
views
Playwright commands are randomly not working leading to timeout errors
I'm making a bot using Python playwright which works but at random times random commands will just be skipped or not work leading to a timeout on the next command.
from multiprocessing.connection ...
5
votes
1
answer
6k
views
ERROR:"It looks like you are using Playwright Sync API inside the asyncio loop. Please use the Async API instead."
I have this setup
File 1
from playwright.sync_api import sync_playwright
class A:
def __init__(self,login_dict):
self.start = sync_playwright().start()
self.browser = self.start....
0
votes
0
answers
175
views
How do I use Playwright (with async methods) and Pytest to create E2E tests?
I'm creating a test suite for E2E tests that validate network requests while navigating and interacting with a website. I'm using Playwright with async and using conftest.py to set up the browser (...
1
vote
1
answer
319
views
Playwright python download get temporary file [closed]
I try to use Playwright and python code to get by code some free reports.
With the following code and an existing chrome debug window, I try to get the report but I get a kind of temporary file not ...
0
votes
1
answer
419
views
If I have a Playwright locator (using sync API and Python), can I determine the HTML element type it is of? [duplicate]
I'm using Sync API and Python for Playwright testing, and I have a python variable that is my locator, already found. I need to know what type of HTML element this locator is, because I need to do ...
0
votes
1
answer
497
views
How to wait for page loading in evaluated code with Playwright? [closed]
I want to fill a two-steps login form with Playwright.
The Playwright execution is controlled by a library, so I cannot change the execution context.
To fill my form, I can only use some Javascript ...
0
votes
0
answers
219
views
CAPTCHA Issues in Headless Mode for TikTok URL Fetching
I'm trying to fetch URLs from a TikTok user page for a research purpose. It works fine with headless=false, but when I set it to headless=true, it triggers a captcha verification. Any ideas on how to ...
0
votes
0
answers
117
views
While using proxy : Error with Python Playwright: ERROR: Request failed.Failure net:: ERR_INVALID_ARGUMENT at ... waiting until "load"
I’m new to Scrapy, and I’d like to load a page using a proxy. When I don’t use a proxy, the response works fine, and I can see my test outputs with print(). However, when I use a proxy, I encounter ...
2
votes
0
answers
147
views
using playwright page.route function, some http headers disappear is this normal?
I'm trying to get playwright to be as close to a regular chrome browser instance as it can be, while also speeding up the loading by removing unneeded requests for things like images. While doing so I ...
3
votes
1
answer
992
views
ModuleNotFoundError: No module named 'scrapy_playwright.middleware'
I am trying out Scrapy Playwright for the first time and following examples online. I am getting the error "ModuleNotFoundError: No module named 'scrapy_playwright.middleware'" when I run ...
0
votes
0
answers
29
views
How to make conditional statements using selectors? [duplicate]
Hello I need to make a conditional statement as follow with python
if (expect(page0.get_by_text("text expect")).to_be_visible()):
page0.get_by_role("button", name="Delete&...
0
votes
1
answer
196
views
How to use a dictionary as parameter in a fixture
When I try to use a dictionary as parameter in a fixture I get this issue:
@pytest.fixture(scope="session")
def user_create(hp_authentification_page,request) -> None:
page ...
0
votes
1
answer
173
views
what is the correct way to pass context to a playwright function when using python django as the basis for a webapp?
I've got a web app that I built first with Flask, then totally rebuilt with Django, to get advantage of the admin interface.
It builds a flyer for a kids football match, using the context to overlay ...
-1
votes
2
answers
330
views
How to identify the child elements of <form> with Playwright?
I would like to know if there is a way to get all of the child elements for an HTML Form.
For example, HTML:
<form>
<input type="text" name="name">
<input ...
0
votes
0
answers
70
views
How to use variable inside fixture that will be set in a test file
I am struggling to see how can a use a variable inside a fixture that will be set inside a test. Let me show you with "code" what I mean:
Here is the fixture I want to use with ...
0
votes
0
answers
55
views
How to move python function to the conftest as fixture?
I have the following python code:
main.py:
import pytest
import re
from playwright.sync_api import Page, expect
from time import sleep
TIMEOUT = 5000 # 5 seconds
# Helper function to send a message ...
0
votes
1
answer
2k
views
New to playwright, can't get any headful browsers to launch
I'm attempting to do an intro to playwright tutorial and can't get any headful browser to open. I'm working on a Windows 11 computer in jupyter notebook (a requirement for the program I'm in) and all ...
1
vote
1
answer
315
views
Playwright python sync client uses async context for some reason
I am trying to write a simple scrapper using Playwright Python library
Here is a basic example how I use it:
from contextlib import contextmanager
from playwright.sync_api import sync_playwright
...
0
votes
1
answer
1k
views
How to Create a Mouse Trail Effect in Playwright for Random Mouse Movements?
I'm using Playwright to automate browser interactions, and would like to create a visual effect where the mouse leaves a trail as it moves randomly across the screen, mimicking natural cursor movement....
1
vote
1
answer
252
views
Playwright in Python: Using :text-matches() with case-insensitive regex for matching names
I'm trying to search for specific names within the HTML of a website using Playwright in Python. I have a list of lowercase names (names_to_find), and I want to match them against names in the HTML ...
1
vote
0
answers
159
views
Crawlee Python: How add custom cookies to a request
What is the right way to add custom cookies (key-value pairs) to a request executed via Crawlee?
Lets say website requires custom-cookie for auth purposes (cookie sid=1234), how to add this cookie to ...
1
vote
2
answers
694
views
Playwright manual download with default file names
I use Playwright to partially automate my tasks but sometimes I need to navigate manually to get to the info I require. As such, I need to download files manually as well, but there doesn't seem to be ...
0
votes
1
answer
1k
views
playwright python how can I catch exception and just gracefully quit
I'm unable to exit a playwright loop cleanly on KeyboardInterrupt/Exception. It is called by subprocess() in our CICD and always fails due to this garble when the system sends <ctrl+c> after ...
0
votes
2
answers
434
views
Python Playwright multiple tabs Page Object Model
Using Python Playwright and Page Object Model
Scenario:
Clicking a link opens a new tab. Rest of the oprations needs to be performed in new page.
Without Page Object model: I was able to accomplish ...
1
vote
1
answer
263
views
Playwright select dynamic element inside form
I'm using Playwright to interact with a webpage containing a form, you can find the full form's HTML code here.
The element of interest is the following:
<div class="form-ajax-success alert ...
2
votes
0
answers
144
views
playwright python , Does Chromium not support uploading mp4 files?
I tried to upload a mp4 files, but it's not working. When I tried changing the file from mp4 to mp3, it worked. I also tried using Firefox and Chrome browser to upload mp4 files, and it worked. ...
4
votes
2
answers
429
views
PKS12 pfx certificate doens't load in python playwright
I'm using playwright python and the usage of PKS12 certificates seems not be working properly.
We try to follow the playwright documentation and this example from stackoverflow too, but none of these ...
0
votes
1
answer
960
views
Python dependency error for playwright and greenlet
coming from Java world and trying to use Python with the playwright module for testing.
I'm using Python 3.13 and got a dependency error trying to install playwright using pip and a requirements.txt ...
0
votes
0
answers
100
views
How can I put each link in its dictionary key?
I am scraping a page and i want to save each link in its own dict key but i do not know how to do it
this the complete code
download_info_list = []
download_info = {"nombre": [], "juego&...
0
votes
2
answers
1k
views
How to maximize browser window in Playwright
I've 2 questions related to python playscript when launching a browser.
Looks like I can use
def test_has_title(page: Page):
page.goto("https://my-url.com")
Another way is
with ...
0
votes
0
answers
293
views
Playwright timeout
I am very new to playwright and I am trying a simple POC where I open a URL, enter user and password and click LOGIN button. Then checking if a particular title is present or not.
This is my simple ...
1
vote
0
answers
142
views
Application alert pop-up not appearing when browser launched via playwright
self.browser = self.playwright.chromium.launch(
headless = False,
slow_mo = 2000,
devtools= True,
args = [
r"--...
0
votes
1
answer
5k
views
playwright cannot bypass cloudflare bot detection even adding cookies and user agents
I'm trying to crawl https://kick.com/browse/categories with playwright which has infinite scroll. I've tried evaluating the below js code and wait for an extended period for loading. I'm turning off ...
1
vote
1
answer
229
views
Cannot perform inifinite scroll using playwright on certain website
I am crawling https://kick.com/browse/categories where every time you scroll it loads new cards of a category. I have tried multiple methods using playwright but none of them worked.
Would appreciate ...
0
votes
0
answers
244
views
Playwright test failing in headless mode due to Paypal button
I have a Playwright test that confirms an e-commerce site's checkout process works, which terminates in clicking a Paypal button, logging into Paypal, and clicking submit payment.
In headed mode, it ...
1
vote
1
answer
291
views
How to add custom headers to one of the multiple temporary redirects using playwright in python?
Is there any way to capture/intercept the temporary re-directs using playwright and add custom headers?
I have a page in which the initial request will give response with status code 303 that will ...
2
votes
1
answer
326
views
How to connect to existing logged in chrome instance in Playwright on MacOs?
My goal is to automate a task on a website that requires login. So I want to login once manually and let the automation run from there. I tried using CRD but when my code runs, it opens a new window ...
0
votes
1
answer
160
views
Playwright - scraping eBay deals
from playwright.sync_api import Playwright, sync_playwright
with sync_playwright() as playwright:
chromium = playwright.chromium
browser = chromium.launch()
context = browser.new_context()...
0
votes
2
answers
221
views
Count of pages found in google search
I am looking for the count of pages where search term "indieea" is found. Visited this page:
https://www.google.com/search?q=%22indieea%22
Goto the last page in search results. You get this ...
0
votes
1
answer
3k
views
google search using playwright
I am trying to perform google search using playwright.
But getting this error:
playwright._impl._errors.TimeoutError: Page.fill: Timeout 60000ms exceeded.
Call log:
waiting for locator("input[...