当前位置: 代码迷 >> 综合 >> python-urllib/urllib2
  详细解决方案

python-urllib/urllib2

热度:44   发布时间:2023-12-22 16:18:40.0

python2 urllib urllib2

pyhton3 urllib ( urllib2 -> urllib.request )


1. download image given url

urllib.urlretrieve(url, filename2save)

with open(filename2save, 'wb+') as f :

        f.write( urllib2.urlopen(url).read() )