Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
Update auto_login.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennox-Elaphurus committed Apr 18, 2023
1 parent 3ba5db5 commit 5a6ecf7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions auto_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,15 @@ def extension_login(email,password):
# browser = webdriver.Chrome(executable_path=ChromeDriverManager().install(), options=chrome_options)

# 设置全局的隐式等待(直到找到元素),20秒后找不到抛出找不到元素
browser.implicitly_wait(15)
browser.implicitly_wait(20)

browser.get('https://music.163.com')

# browser.set_window_size(1500,500) # 设置窗口尺寸
# browser.maximize_window() # 全屏

# 查找登录按钮
target = browser.find_element_by_xpath("//a[text()='登录']")
browser.execute_script('arguments[0].scrollIntoView(true);', target)

time.sleep(2)
time.sleep(10)
# 点击"登录"按钮
logging.info("Click login button")
browser.find_element_by_xpath("//a[text()='登录']").click()
Expand All @@ -49,7 +46,6 @@ def extension_login(email,password):
logging.info("Click agreements")
browser.find_element_by_id('j-official-terms').click()


browser.find_element_by_xpath("//a[text()='网易邮箱帐号登录']").click()

# 进入iframe
Expand Down

0 comments on commit 5a6ecf7

Please sign in to comment.