Reputation: 3
I need help I don't know Python very well. I want to print the text area on my website by pulling automatic questions from a text document for a project question bot project.
Questions = bro.find_element_by_xpath("//*[@id='nopaste']")
Questions.send_keys("example.txt")
Upvotes: 0
Views: 63
Reputation: 436
You need to read the contents from the "example.txt" file and post the details in the test area.
send_keys
only takes a string as input and not the file.
I am from Java, but I think it would look something like this:
Questions = bro.find_element_by_xpath("//*[@id='nopaste']")
file = open("example.txt", "r")
Questions.send_keys(file.readlines())
Upvotes: 1