How to upload file ( picture ) with selenium, python

What I’m doing is this (make sure drv is an instance of webdriver):

drv.find_element_by_id("IdOfInputTypeFile").send_keys(os.getcwd()+"/image.png")

and then find your submit button and click it.

Leave a Comment