I have a piece of code in Python to input a piece of English text into a website (https://edu.visl.dk/visl/en/parsing/automatic/trees.php), and extract the syntactic tree drawn from it. So far, I have been doing this in selenium as follows:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
service = Service(executable_path="c:Program Files (x86)chromedriver.exe")
driver = webdriver.Chrome(service=service, options=options)
driver.get("https://edu.visl.dk/visl/en/parsing/automatic/trees.php")
form = driver.find_element(By.NAME, "theform")
dropdown = form.find_element(By.NAME, "visual")
drop = Select(dropdown)
drop.select_by_visible_text("Vertical")
search = form.find_element(By.NAME, "text")
search.send_keys("John killed the cat with a hammer.")
submit = form.find_element(By.TAG_NAME, "input")
submit.click()
results = driver.find_element(By.TAG_NAME, "pre")
soup = str(bs(results.get_attribute("innerHTML"), "html.parser"))
However, I need to do this over and over again (in a loop), which is way too slow for my purposes. Is there a faster way to do this?