1. 程式人生 > >Selenium3+python自動化6-八種元素元素定位(Firebug和firepath)

Selenium3+python自動化6-八種元素元素定位(Firebug和firepath)

https://www.cnblogs.com/yoyoketang/p/6123834.html https://www.cnblogs.com/yoyoketang/p/6123890.html
# coding:utf-8
from selenium import webdriver


driver = webdriver.Firefox()
driver.get("https://www.baidu.com")

#通過id定位百度搜索框,並輸入“Python”

#driver.find_element_by_id("search-key").send_keys("Python")


driver.find_element_by_class_name("engine-key").send_keys("python")

輸出的結果值是空的。