SHARE
TWEET

Untitled

a guest Jun 27th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <li class="test class" id="111-11-111"> pass </li>
  2. <li class="test class" id="222-22-222"> pass </li>
  3. <li class="test class" id="333-33-333"> pass </li>
  4.      
  5. driver.find_element_by_css_selector(".test.class").get_attribute("id")
  6.      
  7. listOfLi = driver.find_elements_by_xpath("//li[class='test class']")
  8.      
  9. listOfLi = driver.find_elements_by_css_selector(".test.class")
  10.      
  11. for eachLiElement in listOfLi:
  12.     string = eachLiElement.get_attribute("id")
  13.      
  14. print([my_element.get_attribute("id") for my_element in driver.find_elements_by_css_selector('li.test.class')])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top