Problem came from trying to parse response.text rather than response.content with BeautifulSoup