I would like to click on load more button to show all 347 products, however it returns Message: element not interactable, any idea how can i fix it?
from selenium import webdriver
driver=webdriver.Chrome('e:/Users/fungc1/Documents/chromedriver.exe')
from selenium.webdriver.chrome.options import Options
import time
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
options=Options()
url= "https://www.toysrus.com.sg/lego"
driver.get(url)
while True:
try:
btn = driver.find_element_by_xpath("//*[name()='use' and @*='#chevron-circle-thin']")
btn.click()
except Exception as e:
print(e)
break
<svg>tag which is the button picture. What you need to click is the<button>tag that contains the<svg>.<button>tag for the next page just fires a single URL. You could do another request for that.//div[@class='show-more']/button