Resolved character encoding issue resulting from replacing beautifulsoup with lxml.