I'm trying to make selenium click Button1 but for some reasons, I get the following error:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: Button1
I believe the error is happening because it is inside a div/ul/li tag but I can't either figure out how to do it, I'm stuck.
HTML:
<div id="contentArea">
<div class="pageNavigation" id="pageNavigation">
<ul>
<li>
<a href="#">Button1</a>
</li>
<li class="last">
<a href="#">Button2</a>
</li>
</ul>
</div>
</div>
Python Code:
from selenium import *
driver = webdriver.Firefox()
driver.set_window_size(1366, 768, driver.window_handles[0])
driver.get("https://localhost/mypage/index.php")
driver.find_element_by_link_text('Button1').click()
Edit: I found out that the html is generated through javascript. my bad.