0

this issue has been driving me crazy. I am scraping a webpage using the requests module. The string I get in return is this:

x = "\nM\\u00fcnster - Melbourne - New York\n\\ud83d\\udc7b kaptenandson"

I can't seem to be able to get it to output normally, neither on terminal, nor anywhere else (output files, etc.). The text contains an umlaut and two emojis but I am just not able to work with it – drives me crazy.

Further, I have read through the resources on unicode but they haven't been of any help in this case. Are there any other unicode / encoding tutorials in Python I can read?

0

1 Answer 1

0

Figured it out! The string I got was javascript escaped. Pointing to the right answer here:

How do I decode escaped unicode javascript code in Python?

Sign up to request clarification or add additional context in comments.

2 Comments

Link-only answer are discouraged. I closed as a duplicate instead.
Thanks @MarkTolonen!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.