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

Scrapy Playwright removed cookie when using proxy

I tried setting up Scrapy Playwright. Without proxy, cookie applied correctly. But when I use proxy (brightdata), then the cookie is not applied. Did I miss anything? class ScrapyTest(scrapy.Spider): name = 'scrapy test' def…
Jayavinoth
  • 544
  • 1
  • 9
  • 24
0
votes
1 answer

How to try clicking on elements in Playwright without try except block?

I have this code: def try_close_error_popup(self): try: self.page.locator( self.CLOSE, has_text='Close').click(timeout=1200) except TimeoutError: LOGGER.info('Failed to click close popup…
Tal Angel
  • 1,301
  • 3
  • 29
  • 63
0
votes
1 answer

Playwright finds too much elements by text

I tried to find all the elements that has the text "Operation" inside them. I only see one such element visible, but Playwright is giving me 19: self.page.locator('*', has_text='Operation').click() When I run this selector in the developer…
Tal Angel
  • 1,301
  • 3
  • 29
  • 63
0
votes
0 answers

Scrapy Playwright: Does not follow links as intended using CrawlerSpider Class

I have had a hard time trying to follow links using the Scrapy Playwright to navigate a dynamic website. I have read all issues on the Scrapy Playwright GitHub link to see if I can find a solution to my problem, but not yet. OK here it is what I…
0
votes
2 answers

Playwright - Checking Class Name of an Element

I'm testing a site which has a list that needs to be opened or is open already. The class of the element changes according to the state it is currently in. So the element is either div class="list-open" or div class="list-closed" My script has to…
Donnerhorn
  • 59
  • 3
  • 9
0
votes
1 answer

Python Playwright Download only certain files from a page

I'm attempting to download files from a page that's constructed almost entirely in JS. Here's the setup of the situation and what I've managed to accomplish. The page itself takes upward of 5 minutes to load. Once loaded, there are 45,135 links (JS…
0
votes
1 answer

Playwright raises playwright._impl._api_types.TimeoutError even though element was resolved

When I try to use the .click() method of a locator I get this error back: E playwright._impl._api_types.TimeoutError: Timeout 5000ms exceeded. E =========================== logs =========================== E waiting for selector…
0
votes
1 answer

How to pass a variable dynamically to a URL in playwright page.goto function?

I want to pass a variable in the URL, here is my code: url_id = ["253443","456545"] for id in url_id : print("Inside For loop", id) # this print the correct id (253443) …
0
votes
1 answer

Trying to select the option

import time from playwright.sync_api import sync_playwright import pandas as pd with sync_playwright() as p: browser = p.webkit.launch(headless=False) baseurl = "https://www.ifep.ro/justice/lawyers/lawyerspanel.aspx" page =…
Amen Aziz
  • 769
  • 2
  • 13
0
votes
0 answers

Failed to load extension and manifest file is missing or unreadable while trying to test Chrome extensions with Playwright

I am trying to add a Chrome extension to Chromium using Playwright. Use Playwright docs for that purpose with pretty small amendments. path_to_extension = "/Users/name/projects/test_me/src/my_extensions/mm.crx" user_data_dir =…
0
votes
3 answers

Trying to select an email field using playwright

Using playwright I am trying to do a simple login operation on a website The steps are simple : click on a Login button Try to enter an email (Playwrights fails here) I can see that the selector is getting to the correct field but fails to enter…
Reno
  • 33,594
  • 11
  • 89
  • 102
0
votes
0 answers

session_id gotten from my python playwright script different from what i get in the browser

so im trying to scrape an api. I found the url and i can make a post request to retrieve the data by using the session_id i got from opening the site manually. This is the code: import requests import json from cred import session_id, origin,…
0
votes
1 answer

ImportError: cannot import name 'sync_playwright' from 'playwright'

When i start this code i had this error python 3.7 `enter image description here import TikTokApi api = TikTokApi.get_instance(use_selenium=True, executablePath="C:\Program Files(x86)\Google\Chrome\Application")` user =…
0
votes
0 answers

Playwright browser launch function is not working on Heroku

My code: def check_xyz_status(user_input): user_input_list = user_input.split(',', maxsplit=1) if len(user_input_list) != 2: return f"Input is incorrect! Please type your username (email address) followed by a comma (,)…
0
votes
1 answer

How to get playwright working on a docker container and deploy it to AWS Lambda

I am following this tutorial to get playwright installed on a docker container which I am then trying to deploy to an AWS Lambda function: https://tech.smartshopping.co.jp/lambda-container-playwright After following all of the steps I keep getting…