Access LI via Selenium Python

0

How can I access the URL that is inside the li tag?

I want to automate a task but I can not go directly through the URL because it is necessary to log in .... So I have to make the access on the page similar to the step by step that the user does (Login > ; Option), my difficulty is there, when I do the command:

menu = driver.find_element_by_id('nav-Admin').click()

It returns me the following error:

      File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 359, in find_element_by_id
    return self.find_element(by=By.ID, value=id_)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 966, in find_element
    'value': value})['value']
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="nav-Admin"]

I'm using Selenium along with Python

    
asked by anonymous 14.09.2018 / 19:20

0 answers