我想单击该按钮,但是我不知道如何更改路线。我想使用选择器来完成此操作,因此可以将其置于无限循环中,并遍历整个YouTube列表。
boton = '#movie div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > a.ytp-next-button.ytp-button'
buscador.find_element_by_css_selector(boton).click()
如果您尝试单击每个按钮,则可以执行以下操作
boton = '#movie div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > a.ytp-next-button.ytp-button'
numberOfButtons = len(driver.find_elements_by_css_selector(boton))
# now iterate through all the buttons and click on them
for counter in range(numberOfButtons):
driver.find_elements_by_css_selector(buton)[counter].click()