Can I access an already opened file explorer via a Python Script

128 views Asked by At

So, I have a button on a website which opens a instance of file explorer and I want to automatically select a file with a given directory. How am I able to do this via python?

1

There are 1 answers

1
PDHide On BEST ANSWER

you cannot access file explorer using selenium, you have to use tools like autoit ,

one work around is to send file path to input element and click submit button

driver.find_element_by_xpath("//input[@type='file']").send_keys(r"full/filepath")