Appium can't find this String element due to it's double quotes

The “news” section of my app has a lot of different headlines. But the test is failing when it comes across one such as this due to the combination of different quotes:

article_headline = Dolly Parton “cried all night” after rejecting Elvis Presley’s bid to sing ‘I Will Always Love You’

So I’ve tried article_headline.replace(‘"’,‘\"’) to find it “by name” and it still won’t work. The console output for this is:

(Pdb) backend_article.get(“title”).replace(‘"’,‘\"’)
‘Dolly Parton \“cried all night\” after rejecting Elvis Presley's bid to sing 'I Will Always Love You'’

If it was just the single quotes it could be easily handled but I’m not sure why it can’t be found here.

Appium: 1.23.0-beta
Language: Python 3.8

try normalize your text before compare.

for python many examples here ->

oi you search for such element… not compare.

maybe better search by partial text?

Hi Aleksei, the thing is I need to use the actual string to be able to click on the article, so in this case (if I’m not wrong) if I normalize the text first or use partial I’ll be unable to click on it?

Using partial text you find element with this text. Having element you may do whatever like: get it full text, tap …