0

I'm trying to select files from the file system to add to the field which is not a form field, I tried using "send_keys" but didn't work.

Also, is there any way to handle os pop up's like "renaming a file in the download dialog box before saving it"?

Here's the link, please have a look: https://pdfcandy.com/jpg-to-pdf.html

enter image description here

1 Answer 1

1
element = driver.find_element_by_css_selector('input[type="file"]')


element.send_keys(r"<path>\testupload.jpg")

It already has input elemnt

Sign up to request clarification or add additional context in comments.

5 Comments

apologize I'm kinda new to these sort of things, can you please elaborate a little.
First upload the file and then inspect the element and see if an input element is there
yeah, when I upload the files it creates multiple 'img' tags. should I inject these 'img' tags using your solution ?
Could you provide the site link
@Sean it already have inut element updated the answer just send file path to that element

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.