While running the code
def extract():
driver = webdriver.Firefox()
driver.get('http://example.com/')
while True:
elm = driver.find_element_by_link_text(">>").click()
elm.click()
if __name__ == '__main__':
extract()
Page loads and also click's the next button(link) and loads the next page, the newly loaded page also has the same link button but it's not clicking and,
Am getting error:
Traceback (most recent call last):
File "C:\Users\Admin\sel\click_next.py", line 14, in <module>
extract_top_news()
File "C:\Users\Admin\sel\click_next.py", line 11, in extract_top_news
elm.click()
AttributeError: 'NoneType' object has no attribute 'click'
This is the link button in which am trying to click
<li>
<a href='http://example.com/page.php?page=2'>>></a>
</li>
What I am missing!