我正在尝试使用python从网站中提取图像:

相关命令:

import urllib
imagelink =  'http://searchpan.in/hacked_captcha.php?450535633'
urllib.urlretrieve(imagelink, "image.jpg")


使用Firefox查看图像显示以下内容。

python - 无法从网站提取图像-LMLPHP

最佳答案

图片是png,您要做的就是将其另存为'.png'
这是代码

import urllib
imagelink =  'http://searchpan.in/hacked_captcha.php?450535633'
urllib.urlretrieve(imagelink, "image.png")

关于python - 无法从网站提取图像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41393325/

10-11 22:32
查看更多