鍍金池/ 問答/Python/ python 中調(diào)用wget 命令下載報錯

python 中調(diào)用wget 命令下載報錯

save_path = os.path.join("/home/shenjianlin/pdf_file",name)
               try:
                   cmd = ("sudo wget -P -N -o -c -O {} {}".format(save_path, link))
                   ref = subprocess.call(cmd, shell=True)
                   if ref != 0:
                       print ("can't get download")
                   else:
                       print("finishing downloading {} page {} row data".format(i,j))
               except Exception as e :
                   print('download error has happend')
                   print (e)
       

wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
can't get download

/bin/sh: $'350266213345212277345261225346234233-82351241265': command not found
can't get download
《2018暑期旅游消費趨勢預(yù)測》:親子客群占主流? 高檔海島酒店占比提升-6頁.pdf
途牛旅游網(wǎng)
2018-06-22 18:01:38
http://pdf1.qimingpian.com/an...

回答
編輯回答
熟稔

所有位置插入print 就當(dāng)看運行過程 或者 加斷點 debug一下 pycharm 支持比較好
簡單的執(zhí)行命令建議直接使用os.system() 算了

2018年4月22日 00:02