Add an extractor for videofy.me (closes #1171)
Also modify find_xpath_attr to accept values with spaces like for id="HQ on"
This commit is contained in:
parent
70c4c03cb8
commit
bba12cec89
3 changed files with 51 additions and 1 deletions
|
@ -207,7 +207,7 @@ if sys.version_info >= (2,7):
|
|||
def find_xpath_attr(node, xpath, key, val):
|
||||
""" Find the xpath xpath[@key=val] """
|
||||
assert re.match(r'^[a-zA-Z]+$', key)
|
||||
assert re.match(r'^[a-zA-Z@]*$', val)
|
||||
assert re.match(r'^[a-zA-Z@\s]*$', val)
|
||||
expr = xpath + u"[@%s='%s']" % (key, val)
|
||||
return node.find(expr)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue