Python urllib模块urlopen与urlretrieve详解

代码示例:import urllib; url = "baidu.com/"; sock = urllib.urlopen(url); htmlCode = sock.read(); sock.close(); fp = open("e:/1.html","wb"); fp.write(htmlCode); fp.close(); urllib.urlretrieve(url, 'e:/2.html');urlretrieve()方法:urllib模块的urlretrieve()方法直接...
Python urllib模块urlopen与urlretrieve详解
mengvlog 阅读 7 次 更新于 2025-07-21 09:04:50 我来答关注问题0
檬味博客在线解答立即免费咨询

代码相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部