Advertisement
elena1234

scrape Label for elements with Selenium

Oct 27th, 2022 (edited)
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | Source Code | 0 0
  1.  
  2. '''
  3. How to find Label for elements
  4. <label for="categories\\\_36">
  5.  
  6. <label for="categories\\\_38">
  7.  
  8. <label for="categories\\\_6">
  9. '''
  10.  
  11. all_categories = driver.find_elements(By.XPATH,'//label[contains(@for,\'categories\')]')
  12. all_categories = driver.find_elements(By.XPATH,"//label[contains(.,'categories')]")
  13. all_categories = driver.find_elements(By.CSS_Selector, "[id*='chipCat']")
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement