Python: wget randomly prints "-1 / unknown"
command-line, python, wget
Solution
Wget.download() needs a third argument for a progress bar which I left out.
Just add `bar=None` to `wget.download(url, out='cache/page')`:
wget.download(url, out='cache/page', bar=None)
Problem
I have a python script with a few loops and every now and then python prints this: ``` -1 / unknown ``` Does anybody know what could cause this? Also this only happens when I run my script through windows command prompt or through a windows batch file, but not if I run it through PyCharm (a python IDE) ``` import wget def fetch_page(url): wget.download(url, out='cache/page') page_file = open('cache/page', 'r', encoding='utf8') page = page_file.read() page_file.close() return page fetch_page('http://en.wikipedia.org/wiki/Main_Page') ```