1
我想用一個網頁保存一個.jsp圖像到我的電腦上使用python。如何使用python保存圖像?
我試過很多方法,包括
找回功能機械化和 urllib.urlretrieve( 'http://example.com/img.jsp', 'img.jsp')
但問題是,當我嘗試使用它引發以下錯誤
File "code.py", line 71, in extract_image
im = Image.open(image_file)
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1980, in open
raise IOError("cannot identify image file")
我甚至試圖保存圖像.png格式,但它不工作圖像庫中打開圖像。 但我可以通過轉到圖像url手動進行保存,然後保存圖像。
請幫忙!
只是文件包含的內容? –
它可以是任何隨機圖像,甚至背景圖像。 – Themasterhimself
你打算讓我重複我的問題嗎? –