I'm using a web scraping API at https://scrapfly.io, which is returning the contents of the page as an item in a JSON response. I'm able to extract the item but it's formatted with '\n' and escape characters. I just want to return raw HTML so that I can parse it as normal.
This is what I have at the moment...
todos = json.loads(result.text)
output = json.dumps(todos['result']['content'], ensure_ascii=True)
print(output)
And the output looks like this...
"\n<!DOCTYPE html>\n<html lang=\"en-us\">\n<head>\n<title>Google Data...
What I want is...
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>Google Data...
Any help would be greatly appreciated.
Lux
PS: As I suspected, I wasn't processing the response correctly. The correct solution is below. Hope it helps other people.