Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

\u200c instead of real Half space

Tags:

python

I am scraping some HTML pages with python. The text in some spaces has Half space character (\u200c). When i use the text in a variable, every things is OK. The problem is when i add the text to a list, it shows '\u200c' instead of real Half space. what is the problem?

like image 750
keramat Avatar asked Sep 16 '25 02:09

keramat


1 Answers

It will show '\u200c' because it's what __repr__method gives you. However, try printing it using print() and you should get what you want, as print() uses the __str__ magic method.

like image 95
Sam Chats Avatar answered Sep 17 '25 16:09

Sam Chats