【发布时间】:2019-08-24 16:25:24
【问题描述】:
我有一个 XPath,它在 XPath 中有一个单引号,导致 SyntaxError: error。
我已经尝试过转义序列:
xpath = "//label[contains(text(),'Ayuntamiento de la Vall d'Uixó - Festivales Musix')]"
但我仍然面临错误:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//label[contains(text(),'Ayuntamiento de la Vall d'Uixó - Festivales Musix')]' 不是有效的 XPath 表达式.
【问题讨论】:
标签: python selenium selenium-webdriver xpath xpath-1.0