I tried running scraper.py and got the following error saying - "must be unicode, not str". Please see the details below.
/Library/Python/2.7/site-packages/beautifulsoup4-4.6.0-py2.7.egg/bs4/init.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 30 of the file scraper.py. To get rid of this warning, change code that looks like this:
BeautifulSoup(YOUR_MARKUP})
to this:
BeautifulSoup(YOUR_MARKUP, "lxml")
Traceback (most recent call last):
File "scraper.py", line 39, in
new_host = unicodedata.normalize('NFKD', new_host).encode('ascii','ignore')
TypeError: must be unicode, not str
I am not sure how best to solve this. Look forward to hearing from you. Thanks!
Hi,
I tried running scraper.py and got the following error saying - "must be unicode, not str". Please see the details below.
/Library/Python/2.7/site-packages/beautifulsoup4-4.6.0-py2.7.egg/bs4/init.py:181: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 30 of the file scraper.py. To get rid of this warning, change code that looks like this:
BeautifulSoup(YOUR_MARKUP})
to this:
BeautifulSoup(YOUR_MARKUP, "lxml")
Traceback (most recent call last): File "scraper.py", line 39, in
new_host = unicodedata.normalize('NFKD', new_host).encode('ascii','ignore')
TypeError: must be unicode, not str
I am not sure how best to solve this. Look forward to hearing from you. Thanks!
Hemant