XPath Selector Error

Hi,

I have an Xpath like this;

“[
{
“Selector”: “NM”,
“browser”: “chrome”,
“frame”: “-1”,
“url”: “https://www.sahibinden.com/kategori/arsa
},
{
“xpath”: “//label[contains(@class,“quarter-label”) and contains(text(),“Yeni Mah.”)]”
}
]”

I get the following error;

Hello again

I realised my mistake, I was getting this error because of the characters I was using, the following XPath worked fine;

[
{
“Selector”: “NM”,
“browser”: “chrome”,
“frame”: “-1”,
“url”: “https://www.sahibinden.com/kategori/arsa
},
{
“xpath”: “//label[contains(@class,‘quarter-label’) and contains(text(),‘Yeni Mah.’)]”
}
]

1 Like

@mehmetcan
Yes, quotes inside the string needed to be escaped:
“xpath”: “//label[contains(@class,\“quarter-label\”) and contains(text(),\“Yeni Mah.\”)]”

Or use singles like you did

2 Likes

Sorry, saw it was already answered. Glad you found a solution

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.