With the HTML:
<a class="paginate_button next" aria-controls="tabcc" data-dt-idx="7" tabindex="0" id="tabcc_next">Next</a>
I am trying to grab this by class to select the 'Next' innerHTML. I am trying:
next_page = self.driver.find_element_by_class_name('paginate_button next')
and
next_page = WebDriverWait(self.driver, 20).until(
EC.presence_of_element_located((By.CLASS_NAME, "paginate_button next"))
)
but both give the error:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".paginate_button next"}
(Session info: chrome=91.0.4472.114)
Doing the same idea with the ID seems to be working:
next_page = self.driver.find_element_by_id('tabcc_next')
However, I need it to work for the class name for what I am doing specifically.
Any help would be appreciated!