码迷,mamicode.com
首页 > 其他好文 > 详细

selenium3 简单使用

时间:2019-02-03 14:05:56      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:clear   https   url   tps   二次元   input   find   key   rom   

from selenium import webdriver
import time

browser = webdriver.Chrome()
url = ‘https://baidu.com‘

browser.get(url)

input_msg = browser.find_element_by_xpath(‘//*[@id="kw"]‘)
input_msg.send_keys(‘二次元图片‘)

submit = browser.find_element_by_xpath(‘//*[@id="su"]‘)
submit.click()

time.sleep(1)
input_msg.clear()

input_msg.send_keys(‘三次元图片‘)
time.sleep(1)
browser.close()


#Google 71(64 位) + ChromeDriver v2.45

selenium3 简单使用

标签:clear   https   url   tps   二次元   input   find   key   rom   

原文地址:https://www.cnblogs.com/dream-life/p/10350218.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!