Visual Selector - xPath handling misc fixes (#1976)

This commit is contained in:
dgtlmoon
2023-11-13 21:23:43 +01:00
committed by GitHub
parent 5e2049c538
commit f7f98945a2
4 changed files with 20 additions and 9 deletions

View File

@@ -351,7 +351,7 @@ class ValidateCSSJSONXPATHInput(object):
raise ValidationError("XPath not permitted in this field!")
from lxml import etree, html
tree = html.fromstring("<html></html>")
line = line.replace('xpath1:', '')
line = re.sub(r'^xpath1:', '', line)
try:
tree.xpath(line.strip())