Answer the question
In order to leave comments, you need to log in
How to download file by selenium by clicking on input submit button with js script?
I'm trying to download a file by selenium clicking on a bootstrap input button.
The button looks like this:
<input type="submit" value="Экспорт" onclick="hideModal(this);">
driver.execute_script('document.querySelector("#csv-export-form > p.buttons > input[type=submit]").click()')
document.querySelector("#csv-export-form > p.buttons > input[type=submit]").click()'
Answer the question
In order to leave comments, you need to log in
Found! Turns out I was using the wrong webdriver method! You should have used .submit() instead of .click() . And everything worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question