<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
please input your name:<input name="name" class="classname" >
<br>
<a href="http://map.baidu.com">I'm Storm</a>
</body>
</html>
from selenium import webdriver
from time import sleep
"""
通过css定位页面元素
"""
driver = webdriver.Chrome()
driver.get('E:\XueXi\ZDH\DaiMa\DaiMa\CZBK\one\myhtml5.html')
driver.find_element_by_css_selector("body > input").send_keys('css')
sleep(3)
driver.quit()