from selenium import webdriver
import time
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
driver.get(“https://ssl.zc.qq.com/v3/index-chs.html?type=0”)
user_element = driver.find_element_by_id(“nickname”)
time.sleep(5)
print(driver.find_element_by_id(“nickname-tips”).get_attribute(“input-placeholder”))
print(user_element.get_attribute(“input-placeholder”))
print(user_element.get_attribute(“nickname-tips”))
print(user_element.get_attribute(“nickname”))
user_element.send_keys(“test111”)
print(user_element.get_attribute(“value”))
打印结果如下:
None
None
None
None
test111