I try to use selenium to mimic my action on a website to convert PDF files to EXCEL files. There are three steps to complete the conversion:
- Upload the PDF file.
- Input email address.
- Click the 'convert' button.
I wrote the code as below. However, every time I click the button the page just refreshes without actually converting the file.
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://pdftoexcelonline.com/en/')
# Upload file
el_upload = driver.find_element_by_name("file")
el_upload.send_keys(*<Path to the file>*)
# Input email
el_email = driver.find_element_by_name("email")
el_email.clear()
el_email.send_keys(*<email address>*)
# Convert button
el_button = driver.find_element_by_id("convert_now")
el_button.click()
driver.close()
This page works well when I completed the steps manually. What is reason that my code did not trigger the conversion?