Questions tagged [findelement]
180 questions
88
votes
4 answers
find_element_by_* commands are deprecated in Selenium
When starting the function
def run(driver_path):
driver = webdriver.Chrome(executable_path=driver_path)
driver.get('https://tproger.ru/quiz/real-programmer/')
button = driver.find_element_by_class_name("quiz_button")
…

Alexandr
- 999
- 1
- 4
- 7
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
3 answers
Python + Selenium find_element_by_xpath returns dict
-Version-
Python : 3.6.8
Selenium : 3.141.0
I try this.
total_page = driver.find_element_by_xpath('Valid X Path').text
print(total_page)
but,
AttributeError : "dict' object has no attribute 'text'
I Knew....
The find_element~ function returns…

Corona
- 71
- 1
- 3
3
votes
0 answers
How to fix "TypeError: 'str' object is not callable", find_element for selenium web driver
Previous questions are not solving this issue. It's 2022, questions from 2015 aren't helping. I've read previous TypeError:'str' questions on stack overflow and, believe it or not, they're not helping.
What I am trying to do is use find_element() to…

Fitzgerald
- 61
- 7
3
votes
1 answer
Unable to find element using Selenium
Using Selenium, I am unable to locate the "email" element on the Udemy website.
Here's what I tried:
browser.get('https://www.udemy.com/join/login-popup/')
browser.implicitly_wait(5)
email = browser.find_element(By.ID, 'email--1')
print(email)
but…

shasherazi
- 100
- 10
3
votes
0 answers
How to bypass Selenium Block Find Element
If I use find.element by anything (xpath, id, name, etc.), somehow the website can detect that and block my actions. When I take lines with find.element away, code works as intended. Are there any ways to bypass this?

hbae
- 91
- 7
2
votes
2 answers
Selenium Can't Find element by Xpath?
I'm trying to click a button to automatically export a csv file from this site. I've tried finding the element by button name and by Xpath, but the "NoSuchElement" Exception is raised. I've tried variations of WebdriverWait and time.sleep to ensure…

Matt
- 55
- 6
2
votes
2 answers
How to Check all checkboxes
I need to sellect all checkboxes in webpage using python 3.8 and chromedrive.
This function is working in javascript, i want the same code in python
< script type = "text/javascript" >
function selects() {
var ele =…

Stefano
- 21
- 3
2
votes
2 answers
Selenium find element by class breaking code
My program checks a login page for available combinations. Upon first opening up the page, there is a "check availability" button, which has an ID which Selenium is able to find/use to click.
If the username is taken, a new button pops up which says…

Morgan Roberts
- 23
- 3
2
votes
2 answers
Find correct xpath with selenium Python
I'm currently working on a project with Selenium and webdriver. So far so good I can navigate through the website using selenium without any problem however, I would need to click on a specific icon to slides through to a date and time table. Issue…

tboekhorst
- 55
- 1
- 8
2
votes
3 answers
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".ui flu~"}
This is the code I use:
import requests as r, sys as sus, bs4 as bs, webbrowser as wb
from selenium import webdriver as wd
dr = wd.Chrome()
b = r.get("https://uupdump.net/fetchupd.php?arch=amd64&ring=wif&build=latest").text
s = bs.BeautifulSoup(b,…

aritz331_
- 68
- 2
- 9
2
votes
2 answers
Is there a way to structure an if statement so that it can identify if an XPATH exists in python selenium?
I am currently playing around with Selenium trying to learn it by doing and have encountered this issue; occasionally a button on the website appears with a different XPATH, so I wanted to try and create a workaround. This is what I am trying to…

TGFoxy
- 25
- 3
2
votes
4 answers
How to find button element in a table grid
I am a newbie to cypress.
I have a table of users and each row there is edit button. I want to find particular user by email and click on the edit button in that row. Can you please help me locating edit button for my Cypress test?

ChinS
- 199
- 2
- 11
2
votes
2 answers
Rselenium click specific element from list generated by findElements
I have a working code where for a given URL I capture all elements with the same class name. There appear to be three, with different "ElementText" names.
My issue is that I would like to click one of these elements (clickElement), specifically the…

Roberto
- 181
- 8
2
votes
1 answer
Find texts that contains quotation marks by xpath in Selenium
I just got an error in Selenium(Java):
Unable to locate an element with the xpath expression
//*[contains(.,'The field SomeField must be a string or array type
with a maximum length of '60'.')]
Apparently, there are two ' which broke the…

cheny
- 2,545
- 1
- 24
- 30