Selenium Filling Form Information Python
I am trying to scrape from the following website: https://www.legifrance.gouv.fr/rechJuriJudi.do?reprise=true&page=1 I am only interested in a specific subset of the results it
Solution 1:
For a text box, you can use the Selenium find_element_by_id
method and then use the send_keys
method on that element to send whatever input you wish.
browser.find_element_by_id("my_id").send_keys("my_text")
For a dropdown menu, you can use either select_by_index
or select_by_visible_text
.
menu = browser.find_element_by_id("my_dropdown_menu")
menu.select_by_index(index)
menu.select_by_visible_text("text")
Additional Resources:
http://selenium-python.readthedocs.io/locating-elements.html
http://thiagomarzagao.com/2013/11/12/webscraping-with-selenium-part-1/
Post a Comment for "Selenium Filling Form Information Python"