马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我想用手机号登录 但是找不到手机号输入的那个element 这是为什么呢?from selenium import webdriver
from time import sleep
bro = webdriver.Chrome(executable_path="./chromedriver.exe")
wangyi_url = "https://music.163.com/"
bro.get(wangyi_url)
login_url = bro.find_element_by_xpath('//*[@id="g-topbar"]/div[1]/div/a').get_attribute("href")
bro.get(login_url)
bro.switch_to.frame("g_iframe")
switch_btn = bro.find_element_by_id('otherbtn')
switch_btn.click()
agree_btn = bro.find_element_by_id("j-official-terms")
agree_btn.click()
cellphone_btn = bro.find_element_by_class_name("f-mgt10")
cellphone_btn.click()
sleep(2)
# telephone = bro.find_element_by_xpath('//input[@id="p"]')
telephone = bro.find_element_by_id('p')
telephone.send_keys("xxx")
# password = bro.find_element_by_xpath("//input[@id='pw']")
password = bro.find_element_by_id("pw")
password.send_keys("xxx")
|