Friday, August 21, 2020

urrlib

impor urllib

 >>> url="https://www.facebook.com"
>>>
>>> with open('Desktop/deven.txt','w') as f:
...     with urllib.request.urlopen(url) as resp:
...             f.write(resp.read().decode('utf-8')

 

No comments:

Post a Comment