outside-edge / python-espncricinfo

Python wrapper for the ESPNCricInfo JSON API
MIT License
145 stars 64 forks source link

Getting an error #10

Closed hkakkar04 closed 7 years ago

hkakkar04 commented 7 years ago

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