You gotta love a 2-line python solution

Stephen Hansen me+python at ixokai.io
Mon May 2 00:31:41 EDT 2016


On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
> To save a webpage to a file:
> -------------------------------------
> 1. import urllib
> 2. urllib.urlretrieve("http://econpy.pythonanywhere.com
>      /ex/001.html","D:\file.html")
> -------------------------------------

Note, for paths on windows you really want to use a rawstring. Ie,
r"D:\file.html".

-- 
Stephen Hansen
  m e @ i x o k a i . i o



More information about the Python-list mailing list