If you ever hit this error when trying to process HTML:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 7520: ordinal not in range(128)

You can add the following line

thestring.encode('ascii', 'ignore')