1

I'd like to input files from a folder into a website. I was able to input one file but I want to input a file from a folder, run the online job, then input another file from the same folder until all the jobs are submitted. Here's my code for one file input.

from selenium import webdriver
url = "http://www.example.com"

email = "[email protected]"
data = open ("file.txt","r").read()
title = data[16:22].replace("|","")
driver = webdriver.Chrome(executable_path='path_to/chromedriver.exe')
driver.get(url)
emailid = driver.find_element_by_name("email_address")
emailid.send_keys(email)
job = driver.find_element_by_name("job_title")
job.send_keys(title)
submit = driver.find_element_by_name("protein_sequence")
submit.send_keys(data)
driver.find_element_by_class_name("input_button").click()
print submit.page_source

Thank you.

1 Answer 1

1

You can try using mechanize, something like this br.back() and repeat the process.

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

Comments

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.