'Selenium not submiting return button
I'm trying to submit a search in a brazilian stock market webpage.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
browser = webdriver.Firefox()
browser.get('https://www.b3.com.br/pt_br/produtos-e-servicos/negociacao/renda-variavel/empresas-listadas.htm')
time.sleep(10)
searchBar = browser.find_element_by_xpath('//*[@id="keyword"]')
searchBar.send_keys("Petrobras")
searchBar.submit()
But when I run my code I got the following error:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //*[@id="keyword"]
Stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:395:5
element.find/</<@chrome://remote/content/marionette/element.js:300:16
I insert the geckodriver.exe into my python folder. What is wrong with my code?
NOTE: The search bar used in xpath element is Nome da Empresa or Digite o Nome da Empresa
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
