Closed adarmawan117 closed 1 month ago
I have found a solution to the problem above.
sb.click('//div[@aria-label="Pagination"]/a[last()]/button/*[local-name() ="svg"]')
To get the last element, i can use XPATH instead of using the element itself.
But, if you want to add a new function, i really apreciate.
In a normal case, we can click a button like this:
sb.click('//div[@aria-label="Pagination"]/a/button[@class="css-gtd0a9"]')
But, in another case, i need to fetch all elements, and click the latest element like this:
Using Selenium, we can use:
driver.find_elements(By.XPATH, 'selector')[-1].click()