How to use regex in selenium locators

前端 未结 5 1816
陌清茗
陌清茗 2020-12-14 21:49

I\'m using selenium RC and I would like, for example, to get all the links elements with attribute href that match:

http://[^/]*\\d+com

I w

5条回答
  •  一向
    一向 (楼主)
    2020-12-14 22:29

    A possible solution is to use sel.get_eval() and write a JS script that returns a list of the links. something like the following answer: selenium: Is it possible to use the regexp in selenium locators

提交回复
热议问题