Home > Software engineering >  Sendkeys selenium (python)
Sendkeys selenium (python)

Time:01-28

I am scraping a website using selenium with python. This website has a search engine that allows you to write. When I include the text, before hitting enter, I need to wait some time, otherwise it does the search. I wanted to know if there is a way to include a fluentwait instead of using time.sleep()

search_text = browser.find_element(By.CSS_SELECTOR, 'input#wuSearch')
search_text.click()
search_text.clear()
search_text.send_keys('text')
#time.sleep(2)
search_text.send_keys(Keys.ENTER)

CodePudding user response:

There are different types of waits in selenium. You can find Selenium waits also, you can use Explicit waits or Implicit waits based on your code.

  • Related