• <legend id='td154'><style id='td154'><dir id='td154'><q id='td154'></q></dir></style></legend>
    • <bdo id='td154'></bdo><ul id='td154'></ul>

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

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

      1. Selenium在python中按类名查找元素

        Selenium Finding elements by class name in python(Selenium在python中按类名查找元素)

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

            <tbody id='qo9Gq'></tbody>

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

                1. 本文介绍了Selenium在python中按类名查找元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何过滤具有相同类的元素?

                  How can I filter elements that have the same class?

                  <html>
                    <body>
                      <p class="content">Link1.</p>
                    </body>
                  </html>
                  <html>
                    <body>
                      <p class="content">Link2.</p>
                    </body>
                  </html>
                  

                  推荐答案

                  你可以尝试使用 find_elements_by_class_name:

                  You can try to get the list of all elements with class = "content" by using find_elements_by_class_name:

                  a = driver.find_elements_by_class_name("content")
                  

                  然后您可以点击您要查找的链接.

                  Then you can click on the link that you are looking for.

                  这篇关于Selenium在python中按类名查找元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  env: python: No such file or directory(env: python: 没有这样的文件或目录)
                  How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                  Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                  Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                  Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                  When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)
                  • <bdo id='da6o5'></bdo><ul id='da6o5'></ul>
                        <tbody id='da6o5'></tbody>

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

                        <tfoot id='da6o5'></tfoot>

                          <legend id='da6o5'><style id='da6o5'><dir id='da6o5'><q id='da6o5'></q></dir></style></legend>

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