WebJun 12, 2016 · 5 Answers. Sorted by: 66. Leon's comment leads to the correct information that compound class names are no longer supported. What you could do instead is try using css selectors. In your case, the following line of code should help you get the element you want : el3 = driver.find_element_by_css_selector (".action-btn.cancel.alert-display") WebApr 4, 2024 · Each time you call find, you are scraping the page. When possible, you should combine locators into a single locator that will find the element(s) you want. In this case, it's pretty simple. We can use a CSS selector:.x-container [name*='Price'] .FindElement() returns a web element, IWebElement type. You should specify this instead of using var.
c# - Finding Class Elements in a List of Classes - Stack Overflow
WebBy.className is looking for a class with the name entered. By.cssSelector is looking for a match for the selector you entered. What you're attempting is to match the text of the div against class, which won't work. You can try something like this: driver.findElement (By.xpath ("//div [contains (text (),'"+expectedText+"')]")).click (); Share WebNov 23, 2024 · A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. cook computer keyboards
java - finding element by classname and tagname using selenium ...
WebJul 26, 2016 · If the class name is unique in the page then you can use the class name. Keep in mind that the class name might not select the selector you need if there are multiple elements with the same class. As an … WebApr 18, 2016 · as you have specified that the class has to contain a certain word, the following will ensure that the word is: at the start of the string and followed by a space. or in the middle of the string and surrounded by whitespace. or at the end of the … family boom game