Ruthus99 Ruthus99 - 1 year ago 119
Python Question

Receiving a ValueError: Unknown level when running GoogleScraper

I recently decided to get to grips with some python and try to learn my way around the language but i've inevitably ran into a couple of problems that I was hoping someone could help me with.

Basically, I'm running on an OSx machine, I uninstalled the python that came with the operating system and used HomeBrew to download python 3.5.2, all that went successfully. Next I installed GoogleScraper ( which went well after a couple tries, but now, when I try to run a test query through terminal:

GoogleScraper -m http --keyword "apple" -v2

After the machines whizzes and buzzes for a few seconds, it pops out with an error:

GoogleScraper -m http --keyword "apple" -v2
Traceback (most recent call last):
File "/usr/local/bin/GoogleScraper", line 11, in <module>
File "/usr/local/lib/python3.5/site-packages/GoogleScraper/", line 173, in main
File "/usr/local/lib/python3.5/site-packages/GoogleScraper/", line 23, in setup_logger
File "/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/", line 1255, in setLevel
self.level = _checkLevel(level)
File "/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/logging/", line 187, in _checkLevel
raise ValueError("Unknown level: %r" % level)
ValueError: Unknown level: '2'

I've been trying to learn python online and am making some progress, but for the life of me can't figure out what any of that error means, hopefully one of you could at least point me in the direction of a solution.

Many thanks!

Answer Source

As per the source, the logging level is a string that corresponds to a syslog severity level, not a number indicating level of verboseness. This appears to work:

GoogleScraper -m http --keyword "apple" -v INFO