Computational biology PhD researcher. Interested in science, software development, and machine learning. I write about medical research at BioSky.co and contribute content to a variety of additional publications.CVAbout
An issue I recently came across whilst using the Python requests module was that while I was trying to parse HTML text, I couldn’t remove the newline characters ‘
‘ with strip().
The solution is to run the decode() method on the webpage content before you want to parse the text. That will eliminate the behaviour.
import requests url = 'google.com' page = requests.get(url) page.content.decode()