How to click on a button with Selenium

I try to catch the "next" button in a viewer with Selenium in Python, but nothing works and I get an error message.

The code I executed:

from selenium import webdriver
from import WebDriverWait

options = webdriver.ChromeOptions()
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options, executable_path=r'chromedriver.exe')
WebDriverWait(driver, 10)

Until now, everything has been fine. This is where the issue arises.

I want to click on the next arrow: enter image description here

I get the following code while inspecting the source code of this arrow: <div id="next" class="left"><a href="#" title="next">&nbsp;</a></div>

So these are my attempts:



returns an empty list.



returns an empty list.

So, how can I catch this button and click on it?

Read more here:

Content Attribution

This content was originally published by Yanirmr at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: