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()
Latest posts by Jack Simpson (see all)
- Fantastic thesis quotes page - September 18, 2017
- An interesting scam - September 11, 2017
- Honeybees and missing data part 2: Where do bees like to live? - September 9, 2017