Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <input aria-label="Add Photo or Video" accept="video/*, video/x-m4v,
  2. video/webm, video/x-ms-wmv, video/x-msvideo, video/3gpp, video/flv,
  3. video/x-flv, video/mp4, video/quicktime, video/mpeg, video/ogv, .ts, .mkv,
  4. image/*, image/heic, image/heif" containerclassname="_5g_r" multiple=""
  5. name="composer_photo[]" display="inline" role="button" tabindex="0" data-
  6. testid="media-sprout" type="file" class="_n _5f0v" id="js_17y">
  7.  
  8. driver.find_elment_by_id("js_17y").click()
  9.  
  10. selenium.common.exceptions.NoSuchElementException: Message: no such element
  11.  
  12. WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input[aria-label='Add Photo or Video'][name^='composer_photo'][data-testid='media-sprout']"))).click()
  13.  
  14. WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//input[@aria-label='Add Photo or Video' and starts-with(@name, 'composer_photo')][@data-testid='media-sprout']"))).click()
  15.  
  16. from selenium.webdriver.support.ui import WebDriverWait
  17. from selenium.webdriver.common.by import By
  18. from selenium.webdriver.support import expected_conditions as EC
  19.  
  20. from selenium.webdriver.common.by import By
  21. from selenium.webdriver.support.ui import WebDriverWait
  22. from selenium.webdriver.support import expected_conditions as EC
  23.  
  24. WebDriverWait(driver,20).until(EC.element_to_be_clickable((By.XPATH,'//input[@aria-label="Add Photo or Video"][@name="composer_photo[]"]'))).click()
  25.  
  26. driver.find_element_by_class_name("_3jk")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement