python - PhantomJS does not click on a button -
i have been trying solve entire week , last shot @ (asking stackoverflow).
i use phantomjs selenium go login page of youtube , fill in credentials , log in.
i login page , manages fill in email, no matter try, won't click on "next" button.
from selenium import webdriver selenium.webdriver.common.keys import keys selenium.webdriver.common.desired_capabilities import desiredcapabilities selenium.webdriver.common.action_chains import actionchains import time selenium.common.exceptions import nosuchelementexception selenium.webdriver.support.ui import webdriverwait dcap = dict(desiredcapabilities.phantomjs) dcap["-phantomjs.page.settings.useragent-"] = ( "-mozilla-5.0 (windows nt 6.3; wow64) applewebkit-537.36 (khtml, gecko) chrome-34.0.1847.137 safari-537.36-" ) driver = webdriver.phantomjs(desired_capabilities=dcap) driver.set_window_size(1920,1080) driver.get("https://youtube.com") driver.find_element_by_class_name("yt-uix-button-content").click() print("logging in...") driver.find_element_by_id("identifierid").send_keys("email") time.sleep(1) driver.find_element_by_class_name("zfr60d").click() driver.save_screenshot('testing4.png')
now have tried these without luck.
driver.find_element_by_xpath("""//*[@id="identifiernext"]/content/span""").click() driver.find_element_by_css_selector("#identifiernext>content>span").click() webdriver.actionchains(driver).move_to_element(element).click(element).perform() driver.find_element_by_id("identifiernext").click()
i add clicking on element works fine selenium without phantomjs.
when clicking next, there sliding animation takes 1 second.
i appreciate if here me.
Comments
Post a Comment