1

I tried taking some data from the web:

Example:the name 'Schindler's list' is printed as 'Schindler&#x27s List' straight from the web... tried asking python to print 'Schindler\x27s list' instead so that it would give me 'Schindler's list'. But it didn't work.

What do I do?

P.S. This string is one of the many elements in a list and I did the same operation on many other strings in the list as well.

jamylak
  • 128,818
  • 30
  • 231
  • 230
melony
  • 65
  • 3
  • 8
  • 2
    Is that even valid XML/HTML? Doesn't the `'` require a semicolon afterwards? – NPE May 19 '12 at 07:11
  • 2
    You most likely want to know how to unescape HTML entities; which makes this a duplicate of http://stackoverflow.com/questions/2360598/how-do-i-unescape-html-entities-in-a-string-in-python-3-1 http://stackoverflow.com/questions/2087370/decode-html-entities-in-python-string http://stackoverflow.com/questions/57708/convert-xml-html-entities-into-unicode-string-in-python – Dan D. May 19 '12 at 07:11
  • yes... forgot to mention.. it had a semicolon too.. but tried removing all of that and made it print Schindler\x27 list – melony May 19 '12 at 07:13
  • 1
    Can this be marked as answered some way? I came across this looking for unanswered questions. @melony, maybe cut and paste a working code fragment in an answer you yourself provide? – Anthon Jun 05 '12 at 06:15

0 Answers0