2016-04-07 12 views
5

Per esempio:Come posso evitare le doppie virgolette in un Xpath nel selenio?

By.xpath("//*[@id="ext-gen1035"]/div/div[3]/i") 
+1

Eventuali duplicati di [come sfuggire virgoletta singola in xpath 1.0 in selenio per python] (http://stackoverflow.com/questions/32759318/how-to-escape-single-quote-in-xpath-1-0-in-selenium-f o-python) – Philipp

+0

Correlati anche: [Appium xpath escape apostrofi] (http://stackoverflow.com/questions/30778287/appium-xpath-escaping-apostrophes/30778431#30778431) – har07

risposta

7

si può effettivamente utilizzare singoli apici anche:

By.xpath("//*[@id='ext-gen1035']/div/div[3]/i") 

o la fuga doppi apici con un backslash:

By.xpath("//*[@id=\"ext-gen1035\"]/div/div[3]/i") 
Problemi correlati