美文网首页Python专题我爱编程
Selenium----百度首页设置悬浮定位

Selenium----百度首页设置悬浮定位

作者: 右哼哼丨左哼哼 | 来源:发表于2018-02-22 13:50 被阅读177次
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
# 初始化
br = webdriver.Chrome()
# 打开指定网址
br.get("https://www.baidu.com")
# 定位设置元素
frist = br.find_element_by_link_text("设置")
# 鼠标悬浮事件
ActionChains(br).move_to_element(frist).perform()
# 定位搜索设置
menu = br.find_element_by_link_text("搜索设置")
# 点击事件
menu.click()

都是基本操作,大家如若有兴趣,欢迎朋友,可以加交流群:692-858-412一起学习

相关文章

网友评论

    本文标题:Selenium----百度首页设置悬浮定位

    本文链接:https://www.haomeiwen.com/subject/ncxztftx.html