1

I'm trying to search for an Arabic word in an Arabic sentence. I know that the word exists but I will not get the proper response.

var1 = "Good Case" if "حسن" in  cs_tds[6].text.strip() else "NGC"

I know that the word حسن is in cs_tds[6].text.strip() but the response is NGC.

Mahdi
  • 967
  • 4
  • 18
  • 34
  • 1
    can you post the value of `cs_tds[6].text`? – kederrac Feb 11 '20 at 09:53
  • Does it help if you normalize both strings? See e.g. https://stackoverflow.com/questions/16467479/normalizing-unicode – tripleee Feb 11 '20 at 09:56
  • Testing this in my terminal whilst ensuring is in a variable returns "Good Case". Can you provide the value `cs_tds[6].text.strip()`? – RikkiH Feb 11 '20 at 09:56
  • @kederrac Sorry but I cannot paste the value, how to convert cs_tds[6].text.strip() to something searchable ? – Mahdi Feb 11 '20 at 10:14
  • Provide the `repr` of both strings. Perhaps see also the [Stack Overflow `character-encoding` tag info page](http://stackoverflow.com/tags/character-encoding/info) – tripleee Feb 12 '20 at 11:03

0 Answers0