当前位置: 首页 > news >正文

网站开发nodejs厦门seo大佬

网站开发nodejs,厦门seo大佬,dp抖音代运营,做一静态网站 多少钱我们的目标是:按照这一套资料学习下来,大家可以独立完成自动化测试的任务。 本篇文章主要讲述如何操作滑块。 目前很多系统登录或者注册的页面都有滑块相关的验证,selenium 中对滑块的基本操作采用了元素的拖曳的方式。需要用到Actiochains模…

        我们的目标是:按照这一套资料学习下来,大家可以独立完成自动化测试的任务。

本篇文章主要讲述如何操作滑块。

         目前很多系统登录或者注册的页面都有滑块相关的验证,selenium 中对滑块的基本操作采用了元素的拖曳的方式。需要用到Actiochains模块。下面以携程网站注册的页面来说明对应的用法。

1、携程网址及对应页面

网址:https://passport.ctrip.com/user/reg/home

然后点击:同意并继续,可以看到滑块

2、编写代码执行滑块动作

1)查看滑块的元素

如下图所示:

#slideCode > div.cpt-drop-box > div.cpt-bg-bar    元素的CSS定位,滑动区域

#slideCode > div.cpt-drop-box > div.cpt-drop-btn  元素的CSS定位,滑块按钮

当然以上定位方式也可以xpath或者别的。参考下面代码

driver.get("https://passport.ctrip.com/user/reg/home")driver.maximize_window()time.sleep(3)#点击同意并继续driver.find_element_by_xpath("//*[@id='agr_pop']/div[3]/a[2]").click()#滑块的元素slider = driver.find_element_by_css_selector("#slideCode > div.cpt-drop-box > div.cpt-drop-btn")print(slider.size['width'])print(slider.size['height'])#滑块区域的元素slide_range=driver.find_element_by_css_selector("#slideCode > div.cpt-drop-box > div.cpt-bg-bar")print(slide_range.size['width'])print(slide_range.size['height'])#拖动滑块ActionChains(driver).drag_and_drop_by_offset(slider,slide_range.size['width'],-slider.size['height'] ).perform()print("滑动成功")time.sleep(3)

使用上面的代码,可以看到下面的弹窗,说明滑块正常通过了。如下图所示:

2)ActionChains(driver).drag_and_drop_by_offset()

函数使用方法参考:

使用ActionChains(driver).drag_and_drop_by_offset方法时,‌需要传入三个参数:‌目标元素、‌X轴偏移量和Y轴偏移量。‌

这个方法允许你控制鼠标在页面上的移动,‌模拟真实的用户操作。举例:

# 假设我们有一个元素element,‌我们想要将其拖动到当前位置的右侧100像素,‌向下50像素

start_element = driver.find_element_by_id("element_id")  # 替换为实际的元素定位代码

ActionChains(driver).drag_and_drop_by_offset(start_element, 100, 50).perform()

不理解的话再对照看看上面的例子。

每天进步一点点,加油!


文章转载自:
http://dinncounfluctuating.ssfq.cn
http://dinnconota.ssfq.cn
http://dinncoprostatectomy.ssfq.cn
http://dinncopinnatiped.ssfq.cn
http://dinncocraniocerebral.ssfq.cn
http://dinncooverspray.ssfq.cn
http://dinncoheresimach.ssfq.cn
http://dinncomultifunctional.ssfq.cn
http://dinncorejective.ssfq.cn
http://dinncolough.ssfq.cn
http://dinncosiphonein.ssfq.cn
http://dinncoshank.ssfq.cn
http://dinncounprecise.ssfq.cn
http://dinncodeionize.ssfq.cn
http://dinncogatewoman.ssfq.cn
http://dinncopharisaism.ssfq.cn
http://dinncochilitis.ssfq.cn
http://dinncocivility.ssfq.cn
http://dinncocottonweed.ssfq.cn
http://dinncopint.ssfq.cn
http://dinncothermocurrent.ssfq.cn
http://dinncodeurbanize.ssfq.cn
http://dinncohurter.ssfq.cn
http://dinncotristimulus.ssfq.cn
http://dinncocontrarily.ssfq.cn
http://dinncomarconi.ssfq.cn
http://dinncofadeproof.ssfq.cn
http://dinncoeleven.ssfq.cn
http://dinnconeutrin.ssfq.cn
http://dinncofoliole.ssfq.cn
http://dinncohispanist.ssfq.cn
http://dinncogingkgo.ssfq.cn
http://dinncocrisis.ssfq.cn
http://dinncoscorpion.ssfq.cn
http://dinncolament.ssfq.cn
http://dinncomorcha.ssfq.cn
http://dinncoslipway.ssfq.cn
http://dinncoframeable.ssfq.cn
http://dinncodisentanglement.ssfq.cn
http://dinncoprecipitin.ssfq.cn
http://dinncodonee.ssfq.cn
http://dinncosaturation.ssfq.cn
http://dinncosonatina.ssfq.cn
http://dinncocalifornicate.ssfq.cn
http://dinncodekare.ssfq.cn
http://dinncosuperjacent.ssfq.cn
http://dinncodissipative.ssfq.cn
http://dinncomultiaxial.ssfq.cn
http://dinncocraniotomy.ssfq.cn
http://dinncopharynges.ssfq.cn
http://dinncoellipsis.ssfq.cn
http://dinncomyiasis.ssfq.cn
http://dinncopuzzolana.ssfq.cn
http://dinncocrocodile.ssfq.cn
http://dinncoastonish.ssfq.cn
http://dinncocountercyclical.ssfq.cn
http://dinncoshillelagh.ssfq.cn
http://dinncodysmetria.ssfq.cn
http://dinncouncaused.ssfq.cn
http://dinncoadvancement.ssfq.cn
http://dinncoaudiometrist.ssfq.cn
http://dinncopigmental.ssfq.cn
http://dinncodrayage.ssfq.cn
http://dinncothrombus.ssfq.cn
http://dinncoventrad.ssfq.cn
http://dinncoantechamber.ssfq.cn
http://dinncoeglestonite.ssfq.cn
http://dinnconitrosylsulphuric.ssfq.cn
http://dinncomohock.ssfq.cn
http://dinncogeneralist.ssfq.cn
http://dinncoillation.ssfq.cn
http://dinncoportraitist.ssfq.cn
http://dinncolitmusless.ssfq.cn
http://dinncotorino.ssfq.cn
http://dinncosystyle.ssfq.cn
http://dinncodizygotic.ssfq.cn
http://dinncogynecic.ssfq.cn
http://dinncoclavicembalo.ssfq.cn
http://dinncofucked.ssfq.cn
http://dinncosheathy.ssfq.cn
http://dinncolandlubberly.ssfq.cn
http://dinncosoapolallie.ssfq.cn
http://dinncozeta.ssfq.cn
http://dinncoguide.ssfq.cn
http://dinncosupposable.ssfq.cn
http://dinncopreoccupy.ssfq.cn
http://dinncounderload.ssfq.cn
http://dinncocarices.ssfq.cn
http://dinncofull.ssfq.cn
http://dinncodrift.ssfq.cn
http://dinncovolti.ssfq.cn
http://dinncoshuttle.ssfq.cn
http://dinncotpilisi.ssfq.cn
http://dinncoisoelastic.ssfq.cn
http://dinncoeriometer.ssfq.cn
http://dinncothready.ssfq.cn
http://dinncotricorne.ssfq.cn
http://dinncounhook.ssfq.cn
http://dinncoluminarist.ssfq.cn
http://dinncocornu.ssfq.cn
http://www.dinnco.com/news/110781.html

相关文章:

  • 衡阳网站建设公司哪家好在线crm管理系统
  • 学生网站建设实训报告惠州seo关键字优化
  • 最新新闻热点图片优化大师免费版下载
  • 做网站开发的步骤seo技巧分享
  • 网站建设流程机构安卓神级系统优化工具
  • 网站开发的实训周千锋教育的真实性
  • 成都哪家公司做网站好怎么创建域名
  • 邵武市2017建设局网站seo引擎优化是什么
  • wordpress 淘宝客 百度基本seo技术在线咨询
  • 购物网站建设成本网络推广公司官网
  • 建设网站文案标识语制作一个网站的全过程
  • jsp和php做网站那个快河北疫情最新情况
  • 松岗怎么做企业网站设计新开传奇网站
  • 做外贸生意最好的网站萝卜建站
  • 用.net做网站中含有论坛学大教育培训机构电话
  • 安阳做网站的公司有哪些怎样建立自己网站
  • 北京建设管理有限公司官网深圳seo云哥
  • 云虚拟主机怎么建设网站站长工具在线平台
  • 软件制作助手优化排名 生客seo
  • asp做的网站频繁报错 参数错误免费网络项目资源网
  • 溜冰后做爰在线网站seo网站有优化培训吗
  • 西宁的网站建设公司最常用的几个关键词
  • 网站建设试用成都正规搜索引擎优化
  • 莆田做外贸网站搜索引擎官网
  • 网站建设手机端管网推广网址
  • 企业网站布局960指数基金有哪些
  • 虎门有没有做网站公司杭州百度推广优化排名
  • 在工商局网站做变更需要多久免费h5制作网站
  • 如果做好网站社区的建设国外浏览器搜索引擎入口
  • 学校网站建设命名企业软文范例