Questions tagged [findelement]
180 questions
0
votes
3 answers
Selenium Python: Click on element with explicit string works but not when string is replaced by variable
When using the explicit text it works and the found element is clicked on but not when I use the variable:
This is the div:
68915969-LS
This works:
result =…
Daniel
- 59
- 4
0
votes
2 answers
When trying to capture xpath of checkbox, ::before is getting highlighted, How do I capture xpath?
enter image description here
[enter image description here][3]
driver.find_element_by_xpath("//div[@class='form-group field-user-terms required']/label").click()
I tried with the above xpath, instead of selecting checkbox. It is clicking on "Terms…
0
votes
1 answer
Button click using selenium webdriver youtbe example
When I run the code, it opens the browser, but I want to click the reject all button when the cookie banner comes from YouTube. I tried using class and a link text. It did not work.
I will appreciate any help.
from selenium import webdriver
from…

GoogleTagger
- 17
- 1
0
votes
1 answer
For some reason selenium doesn't locate existing web elements
I'm trying to build a Whatsapp bot in java using selenium and I'm working on a function that shows on the screen the response of a recipient that got messaged by the bot earlier.
I found the class "_2wUmf _21bY5 message-in focusable-list-item" to be…

DGStar
- 17
- 7
0
votes
1 answer
How to find elements by calendar date using selenium in python?
I'm trying to scrape the table values from the link below by adjusting the calendar dates to be between two specific dates:
https://markets.businessinsider.com/earnings-calendar
I use the code block below, but the last line does not work:
from…

Amir
- 1
0
votes
2 answers
TypeError: 'str' object is not callable (FIndElement)
i try to find an Element by Text. If i want to click the Element i'll get the following Error:
TypeError: 'str' object is not callable
Any Idea how to fix that?
Here is my code
import time
from selenium import webdriver
from…

Manyou
- 21
- 2
0
votes
2 answers
Short form of find_element Python Selenium
I just upgraded to Selenium 4. This resulted in Depreciation warnings from my Python scripts about calls to find_element_by_xxxxx(). the warning suggests this form.
Select(driver1.find_element(by=By.NAME, value="age_max")).select_by_index(81)
But…

Peter Hill
- 43
- 1
- 6
0
votes
2 answers
Finding identical buttons with selenium python
I am trying to find a button on a website, however this button won't always be there and there are multiple buttons that are identical in everyway. The xpath of the buttons is…

Rap
- 1
0
votes
2 answers
Find items within tags using Selenium
I've tried to find the element item (eg. Item1, Item2, Item3, and Item4) within the 'li' tag using Selenium, but an error happened with this message:
no such element: Unable to locate element
How do I find the items within the 'li' tag…

Chris Joo
- 577
- 10
- 24
0
votes
1 answer
Selenium Python - Finding all elements in a class if not found refresh until found
I am looking to make a script to look for a specific class and select all elements that are assigned this class. I want it to click on each of these elements and when done to go to another page. It needs to run in a loop so if the elements have not…

John Stepehns
- 27
- 4
0
votes
3 answers
Selenium Is returning error No such Element: Unable to locate the element
I am trying to Web scrape Indeed Jobs using both selenium and beautiful soup, I am able to extract all the details from the Job but to get the Job description I have used Selenium, But when I am trying to find the Job-description Id it's returning…

sonam mehra
- 1
- 1
- 1
0
votes
1 answer
List of WebElements by Selenium and Java
I am get the elements of a tag from below part of HTML.

小林 新一郎
- 11
- 1
- 3
0
votes
2 answers
React.Js Find which element of the array is selected by the user
Basically I have a component that is a list of rooms that a user has joined. On top of this component there is a search section, and aside of the search input there are some options about the search, like search by "Room Name" , search by…

Oren Papa
- 35
- 1
- 7
0
votes
1 answer
Selenium Python find_element Xpath cant find xpath
I want to access an website with selenium and than a addblock-window appears, in which i need to click a button for it to disappear.
Eventhough I can find my XPath(//button[@title='Einverstanden'], /html/body/div/div[2]/div[3]/div[1]/button[@title…

Damiano
- 3
- 3
0
votes
3 answers
How to use CSS selector with strings
I've been trying to create a program that finds data on a site using selenium. I've downloaded the webdriver and by module.
driver.get("https://en.wikipedia.org/wiki/Main_Page")
number = driver.find_element(By.CSS_SELECTOR("articlecount…

Licheng Zheng
- 13
- 5