0

我正在尝试使用 selenium 自动为单个域更新我的 noip 帐户。我几乎完成了,但未能单击最终按钮“立即确认您的主机名”,这是我的代码

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
import time


chrome_options = Options()
#chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('disable_gpu')
chrome_options.add_argument("--window-size=1366,768")
chrome_path='r/usr/bin/chromedriver'

driver=webdriver.Chrome(executable_path='/usr/bin/chromedriver', options=chrome>

action=ActionChains(driver)
driver.get("https://www.noip.com") 
time.sleep(2)
driver.find_element_by_xpath('//*[@id="topnav"]/li[1]/a').click()
#driver.find_element_by_xpath('//*[@id="loginForm"]/input[1]').send_keys("09003>
usuario=driver.find_element_by_name("username")
time.sleep(1)
usuario.send_keys("myemail@example.org")
password=driver.find_element_by_name("password")
password.send_keys("mypassword")
driver.find_element_by_id("loginForm-captcha-button").click()
time.sleep(2)
driver.find_element_by_xpath('//*[@id="content-wrapper"]/div[1]/div[2]/div[1]/d>
time.sleep(2)
driver.find_element_by_xpath('//*[@id="host-panel"]/table/tbody/tr/td[5]/button>
time.sleep(2)
driver.find_element_by_xpath('//*[@id="content"]/section[2]/div/div/div[1]/p[2]>
time.sleep(5)

driver.switch_to.frame(driver.find_element_by_tag_name("iframe"))
driver.find_element_by_xpath("//*[@id='recaptcha-anchor']/div[1]").click()

driver.switch_to.default_content

问题代码

#this actually doesn't work    
driver.find_element_by_xpath('//*@id="content"]/section[2]/div/div/div[2]/form/button').click()

有人可以告诉我我做错了什么吗?

4

0 回答 0