-sharpcoding:utf-8
from selenium import webdriver
import time,os,sys
def withoutCookieLogin(url):
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(chrome_options=options)
options.add_argument("lang=zh_CN.UTF-8")
options.add_argument("user-agent="Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"")
driver.maximize_window()
driver.get(url)
driver.find_element_by_class_name("tab-log-type pull-right").click()
driver.find_element_by_id("uc-common-account").clear()
driver.find_element_by_id("uc-common-account").send_keys("name")
driver.find_element_by_id("ucsl-password-edit").clear()
driver.find_element_by_id("ucsl-password-edit").send_keys("password")
authCode = input("")
driver.find_element_by_id("uc-common-token").send_keys(authCode)
driver.find_element_by_id(u"submit-form").click()
return driver
driver = withoutCookieLogin("http://cas.baidu.com/?tpl=www2&fromu=http%3A%2F%2Fwww2.baidu.com%2F")``
other websites are fine. Phoenix Nest can"t find element, in the backstage search. You have noticed that the chrome browser that opens cannot see the element, right button to edit as html, the body before you can see it. Python novice, ask for advice from big hands, thank you!