1. <legend id='7CkVs'><style id='7CkVs'><dir id='7CkVs'><q id='7CkVs'></q></dir></style></legend>
      <tfoot id='7CkVs'></tfoot>
        <bdo id='7CkVs'></bdo><ul id='7CkVs'></ul>

      <small id='7CkVs'></small><noframes id='7CkVs'>

        <i id='7CkVs'><tr id='7CkVs'><dt id='7CkVs'><q id='7CkVs'><span id='7CkVs'><b id='7CkVs'><form id='7CkVs'><ins id='7CkVs'></ins><ul id='7CkVs'></ul><sub id='7CkVs'></sub></form><legend id='7CkVs'></legend><bdo id='7CkVs'><pre id='7CkVs'><center id='7CkVs'></center></pre></bdo></b><th id='7CkVs'></th></span></q></dt></tr></i><div id='7CkVs'><tfoot id='7CkVs'></tfoot><dl id='7CkVs'><fieldset id='7CkVs'></fieldset></dl></div>

        如何在硒中移动鼠标?

        How to move the mouse in Selenium?(如何在硒中移动鼠标?)
          <i id='XYPP3'><tr id='XYPP3'><dt id='XYPP3'><q id='XYPP3'><span id='XYPP3'><b id='XYPP3'><form id='XYPP3'><ins id='XYPP3'></ins><ul id='XYPP3'></ul><sub id='XYPP3'></sub></form><legend id='XYPP3'></legend><bdo id='XYPP3'><pre id='XYPP3'><center id='XYPP3'></center></pre></bdo></b><th id='XYPP3'></th></span></q></dt></tr></i><div id='XYPP3'><tfoot id='XYPP3'></tfoot><dl id='XYPP3'><fieldset id='XYPP3'></fieldset></dl></div>

              <small id='XYPP3'></small><noframes id='XYPP3'>

                <tbody id='XYPP3'></tbody>
              <legend id='XYPP3'><style id='XYPP3'><dir id='XYPP3'><q id='XYPP3'></q></dir></style></legend>
                <tfoot id='XYPP3'></tfoot>
                  <bdo id='XYPP3'></bdo><ul id='XYPP3'></ul>

                • 本文介绍了如何在硒中移动鼠标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试图模拟鼠标在随机曲线或抛物线上的移动,这样看起来鼠标实际上是在页面上移动。使用Selenium,我只知道如何点击元素,但这并不能模拟一些网站上的真实用户。我希望鼠标沿着我计算的一条随机线移动,然后单击该元素。

                  python

                  推荐答案代码如下所示(假设您的浏览器是火狐):

                  driver = webdriver.Firefox(executable_path=driver_path)
                  action = webdriver.ActionChains(driver)
                  element = driver.find_element_by_id('your-id') # or your another selector here
                  action.move_to_element(element)
                  action.perform()
                  

                  请注意,这不会移动您的物理光标,而只是看不见的Selenium光标。要查看它是否起作用,元素必须具有某种"悬停"效果。 此外,如果您已经将光标移动到某个元素,并且想要相对地重新定位它,则可以使用:

                  action.move_by_offset(10, 20)    # 10px to the right, 20px to bottom
                  action.perform()
                  

                  或更短:

                  action.move_by_offset(10, 20).perform()
                  
                  此处提供了更多文档: https://selenium-python.readthedocs.io/api.html

                  这篇关于如何在硒中移动鼠标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                  Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                  Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                  Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                  Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                  Grouping pandas DataFrame by 10 minute intervals(按10分钟间隔对 pandas 数据帧进行分组)
                    <tbody id='BEHFc'></tbody>

                    <small id='BEHFc'></small><noframes id='BEHFc'>

                    <i id='BEHFc'><tr id='BEHFc'><dt id='BEHFc'><q id='BEHFc'><span id='BEHFc'><b id='BEHFc'><form id='BEHFc'><ins id='BEHFc'></ins><ul id='BEHFc'></ul><sub id='BEHFc'></sub></form><legend id='BEHFc'></legend><bdo id='BEHFc'><pre id='BEHFc'><center id='BEHFc'></center></pre></bdo></b><th id='BEHFc'></th></span></q></dt></tr></i><div id='BEHFc'><tfoot id='BEHFc'></tfoot><dl id='BEHFc'><fieldset id='BEHFc'></fieldset></dl></div>
                  1. <tfoot id='BEHFc'></tfoot>
                    • <legend id='BEHFc'><style id='BEHFc'><dir id='BEHFc'><q id='BEHFc'></q></dir></style></legend>

                          • <bdo id='BEHFc'></bdo><ul id='BEHFc'></ul>