Answer the question
In order to leave comments, you need to log in
Find_element syntax in Selenium 4?
Hello!
Please help me figure it out ...
In the old version, everything was simple and the paycharm suggested)
And how is it in the new version?
Thank you!
driver.find_element_by_xpath('здесь сам Xpath')
Answer the question
In order to leave comments, you need to log in
https://www.selenium.dev/documentation/getting_sta...
Before
driver.findElementsByClassName("className");
driver.findElementsByCssSelector(".className");
driver.findElementsById("elementId");
driver.findElementsByLinkText("linkText");
driver.findElementsByName("elementName");
driver.findElementsByPartialLinkText("partialText");
driver.findElementsByTagName("elementTagName");
driver.findElementsByXPath("xPath");
driver.findElements(By.className("className"));
driver.findElements(By.cssSelector(".className"));
driver.findElements(By.id("elementId"));
driver.findElements(By.linkText("linkText"));
driver.findElements(By.name("elementName"));
driver.findElements(By.partialLinkText("partialText"));
driver.findElements(By.tagName("elementTagName"));
driver.findElements(By.xpath("xPath"));
from selenium.webdriver.common.by import By
driver.find_element(By.XPATH, xpath)
As it was, so everything remains. The method takes only two parameters - By and the search string, there is nothing to highlight there
from selenium.webdriver.common.by import By
driver.find_element(By.XPATH, '//button[text()="Some text"]')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question