I am a beginner with Selenium and I'm currently attempting to input text and click a submit button in order to navigate to the search result page. I have attempted:
Finding an element by class name, but it doesn't work due to having a space. I've reviewed the documentation on locating elements, but I'm struggling to determine what method would be successful in this situation.
Simulating pressing the Enter key to submit it.
Neither of these methods seem to be effective. Does anyone have suggestions on how I can locate this button and successfully press/click on it?
Upon inspecting the page, I found the following code:
<a href="javascript:void(0)" title="Submit" onclick="$('#form_topsearch').submit();" class="btn_black btn_search FR"></a>
Here's the snippet of my code:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.moneycontrol.com")
searchText = driver.find_element_by_id("search_str")
searchText.send_keys("dlf")
# The text inputs just fine up until this point, however, submitting the entry remains a challenge.