开发者

save a webpage with urllib

开发者 https://www.devze.com 2023-02-16 18:58 出处:网络
import u开发者_StackOverflow中文版rllib url=\'www.something.com/something..\' f = urllib.urlretrieve(url,\'copy.html\')
import u开发者_StackOverflow中文版rllib
url='www.something.com/something..'
f = urllib.urlretrieve(url,'copy.html') 

this code only creates a html file which provides direct link to the url specified (ie, it is not accessible offline). How to to store the webpage so that it will be available offline.??


You need to get all the other resources the page is pointing to (CSS files, images ...).

I suggest that you use "wget", it already does what you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号