模拟登录网易云
我想用手机号登录 但是找不到手机号输入的那个element{:10_284:}这是为什么呢?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/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") 只能扫码登录啊
网易云越来越不像话
页:
[1]