0

I'm trying to automate uploading a file using selenium webdriver in Python. Right now, I have the following code:

url = "https://uploadfiles.io/"
driver = webdriver.Firefox(executable_path="/path/to/firefoxdriver")
driver.get(url)
getForm = driver.find_element_by_xpath("//form[@class='dropzone needsclick dz-clickable']")
getForm.send_keys("/path/to/somefile")

However, this doesn't work. For some weird reason it tries to find the text I'm sending in to send_keys on the page (like when you do command+f).

user23899
  • 101
  • 2

2 Answers2

0

you must recheck X-PATH selector, now the class has been changed to [ufzone needsclick dz-clickable]. choose the right selector , you will get

-1

As explained here: Upload, this form is not an input, so you might need to go about it differently. The robot thing should work, provided that the field for typing is focused when opened.

StopTheRain
  • 367
  • 1
  • 5
  • 15