Python Forum

Full Version: Code example for entering input in a textbox with requests/selenium object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I am scrapping a website with requests/selenium and I want to enter some text into a textbox and click a button on the returned page. I had seen few code snippets for this in some of the threads in this forum, but cant locate them now. Can someone please point me to one of those examples.

send_keys() - That is what I was looking for. Found it at below thread

https://python-forum.io/Thread-How-to-se...ing-python
first, import 'By' by adding at top: from selenium.webdriver.common.by import By
Then you need to locate the button.
you do this by using the inspect option:
  • right click on button
  • select inspect element
  • right click on highlighted html
  • select copy-->XPATH
  • Paste into statement: browser.find_element(By.XPATH, 'Paste here').click()
  • That should do it