Python, Selenium and Phantomjs

Asked

Viewed 377 times

0

I’m using Selenium with Python and Phantomjs. I want to click a button from the youtube page, but it always gives an error. Someone can help me? inserir a descrição da imagem aqui

  • Which code do you already have, and where is the error? Which button? It’s impossible to help you if you don’t provide more information. Welcome http://answall.com/tour

  • It’s the "Show More" button on the side. The code is: "driver = webdriver.Phantomjs() driver.get("https://www.youtube.com/watch?v=uyWX8hdknvU") driver.find_element_by_class_name("yt-uix-button yt-uix-button-size-default yt-uix-button-Expander")

  • 2

    What he told you is that you are trying to use a class name that has spaces... making it a "compound class" or "compound class".. Try using another selector to pick a simple class... for example b = driver.find_element_by_xpath('//span[@class="yt-uix-button-content"') and then click on the selected object using b.click()

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.