//*[contains(concat(' ', @class, ' '), ' btns right ')]//*[contains(concat(' ', @class, ' '), ' expand-all ') and contains(text(), 'View All Cards')]
提供一些等待元素可点击(建议隐式)。
我只用于java,但是我在这里引用了python ,这可能有帮助!
from selenium.webdriver.support import expected_conditions as EC
wait = webdriverwait(driver, 10)
button = wait.until(EC.element_to_be_clickable((By.XPATH,'//*[contains(concat(' ', @class, ' '), ' btns right ')]//*[contains(concat(' ', @class, ' '), ' expand-all ') and contains(text(), 'View All Cards')]')))
button.click()
Even if the above thing fails, try this
形成这些链接link1和link2
driver.execute_script("document.getElementsByClassName('expand-all')[0].click();")
可能是您的应用属于link2 OP :)