Questions tagged [selenium-webdriver-python]
73 questions
4
votes
1 answer
Your requested host "localhost" could not be resolved by DNS error accessing website using Selenium Python
I am trying to use selenium on Windows. Whenever I run this code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
path = "C:/Users/User/Webdriver/chromedriver.exe"
driver =…

Brian Hode
- 75
- 1
- 5
4
votes
2 answers
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid locator error using find_element('username') Selenium Python
I am running python 3.9 with the following code. When I run the script I get the error message. Not sure what I am missing. The element is called username.
File "/Users/user/Documents/PycharmProjects/webscrapping/app/webscraping.py", line 19, in…

Marvin The Martian
- 93
- 1
- 1
- 7
4
votes
5 answers
selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist with chromium browser and Selenium Python
I want to run selenium through chromium. I wrote this code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options =…

Dima
- 107
- 1
- 1
- 7
3
votes
1 answer
How to search for an element and incase it does not exist search for another element using Selenium Python
I'm trying to search for an element and if it doesn't exist search for another element, and here is my code:
try:
elem1 = driver.find_element_by_xpath('xpath1')
elem = driver.find_element_by_xpath("xpath2")
if elem.is_displayed():
…

wezzo
- 49
- 5
3
votes
1 answer
Initialising MSEdge Browser in python, getting TypeError: Level not an integer or a valid string: None
I am trying to Initialise the MSedge Browser and getting an error.
from selenium import webdriver
from selenium.webdriver.edge.service import Service
from webdriver_manager.microsoft import…

Charan Supraj Baru
- 33
- 6
2
votes
1 answer
ERROR:page_load_metrics_update_dispatcher.cc(194)] Invalid first_paint error using Selenium Python ChromeDriver
I am just starting to learn selenium but when I run the program it opens the chrome window for few seconds and then closes giving the error:
DevTools listening on…

Ayush Meher
- 29
- 1
- 4
2
votes
1 answer
How to click 'View' button using Selenium on Wunderground Historical Weather page
I'm trying to access the "View" button on the "https://www.wunderground.com/history" website using Selenium in Python but I'm unable to do so. I've tried multiple methods…

Shai Shillo
- 23
- 4
2
votes
2 answers
AttributeError: module 'selenium.webdriver.common.by' has no attribute 'XPATH' using Selenium Python
I'm starting in programming, so I created a simple code, but it's giving this error:
I'm using Jupyter Notebook, this is the code, if anyone knows what the problem is, please help me
2
votes
1 answer
OSError: [Errno 8] Exec format error: '/home/ec2-user/Desktop/chromedriver' error using Chromedriver in AWS EC2 ARM flavour machine
I have an EC2 machine from AWS with ARM flavour. I installed Python 3, and then used pip3 to install Selenium. I then downloaded the Linux version of chrome driver from here, unzipped it and kept the chromedriver file in Desktop. When I try to run…

SexyBeast
- 7,913
- 28
- 108
- 196
2
votes
1 answer
Selenium - set_window_size() always returning same sized window irrelevant of dimensions specified
I am trying to set window size for Firefox Selenium via Python. However, the window is always being resized to the same size, irrelevant of the dimensions passed as parameters to the set_window_size() function.
Below is the code I am…

cristina_gatt
- 23
- 4
2
votes
1 answer
python selenium webdriver chrome
from selenium import webdriver
d = webdriver.Chrome("/usr/bin/chromedriver")
d.get("https://google.co.in")
error:
[Running] python -u "/home/nourhene/py/hi.py"
Traceback (most recent call last):
File "/home/nourhene/py/hi.py", line 11, in…

nourhene hammouda
- 21
- 3
1
vote
2 answers
Error parsing cert retrieved from AIA (as DER) & ERROR: Couldn't read tbsCertificate as SEQUENCE & ERROR: Failed parsing Certificate using Selenium
I've been webscraping and for a variety of webpages certification worked well. That's why I don't understand the following problem:
That's my code:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from…

N8walker
- 11
- 1
- 2
1
vote
2 answers
With Selenium on CentOS 7, getting a MoveTargetOutOfBoundsException on my CentOS 7, which doesn't occur when the script is run on Mac OS Big Sur
I'm using Python 3.9 with the latest Selenium and have this code, which runs fine on my Mac, Chrome driver 101 headless instance of my script ...
element = self.driver.find_element(By.CSS_SELECTOR, "body")
actions = ActionChains(self.driver)
…

Dave
- 15,639
- 133
- 442
- 830
1
vote
1 answer
How can I adapt the following code to run in headless mode?
I am working with the following code:
import time
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium import…
user2361290
1
vote
0 answers
Control Vivaldi browser
I want to manage the tabs of Vivaldi (Windows) using Python: get URLs, focus a specific tab, open, close, reload...
This post asks how to open Vivaldi, and my script does it, but not when/how it's supposed to do it:
from selenium import…

DavidBevi
- 61
- 10