Wednesday, March 18, 2020

Python Script to Fetch Webpage Source

# save-webpage.py

import urllib2

for i in range(4,20):
url = 'https://namaanakperempuan.net/nama-bayi-perempuan-jawa-dan-artinya/%d/'%(i)

response = urllib2.urlopen(url)
webContent = response.read()

f = open('bayi%d.html'%(i), 'w')
f.write(webContent)
f.close





No comments:

Post a Comment