File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,27 @@ def is_xpath_selector(selector):
43
43
return False
44
44
45
45
46
+ def is_link_text_selector (selector ):
47
+ """
48
+ A basic method to determine if a selector is a link text selector.
49
+ """
50
+ if (selector .startswith ('link=' ) or
51
+ selector .startswith ('link_text=' )):
52
+ return True
53
+ return False
54
+
55
+
56
+ def get_link_text_from_selector (selector ):
57
+ """
58
+ A basic method to get the link text from a link text selector.
59
+ """
60
+ if selector .startswith ('link=' ):
61
+ return selector .split ('link=' )[1 ]
62
+ elif selector .startswith ('link_text=' ):
63
+ return selector .split ('link_text=' )[1 ]
64
+ return selector
65
+
66
+
46
67
def is_valid_url (url ):
47
68
regex = re .compile (
48
69
r'^(?:http)s?://' # http:// or https://
You can’t perform that action at this time.
0 commit comments