I'm currently using a Macbook Air running OS X El Capitan. I'm using the Python IDLE and trying to select and click on the following webpage button:
<div class="search-form-actions">
<button class="btn btn-submit js-search-form-submit" selector=".js-search-form-submit" helptip="When you are ready to view all the contacts that match your criteria, click View Results." data-placement="top" data-step-number="5" data-step-name="Get Results">View Results</button>
</div>
By using the following script:
from selenium import webdriver
browser = webdriver.Firefox()
type(browser)
browser.get('https://app.avention.com/')
#enter username
usernameElem = browser.find_element_by_name("username")
usernameElem.send_keys('myusername')
usernameElem.submit()
#enter password
usernameElem = browser.find_element_by_name("password")
usernameElem.send_keys('mypassword')
usernameElem.submit()
#selecting 'Saved Searches' page
htmlElem = browser.find_element_by_tag_name("html") #without this line, site blocks next command
browser.get('https://app.avention.com/search/saved/7a1fbf2d-329a-4fda-8c51-4be5bc07317c#')
#selecting 'View Results' button
resultsElem = browser.find_element_by_class_name("btn.btn-submit.js-search-form-submit").click()
I receive the following error:
NoSuchElementException: Message: Unable to locate element: {"method":"class name","selector":"btn.btn-submit.js-search-form-submit"}
I have tried to find_element_by_class_name
I have tried to find_element_by_name
I have tried to find_element_by_id
I have tried to find_element_by_link_text
But with no success. Any suggestions. Many thanks.
Gavin.