Skip to content

Instantly share code, notes, and snippets.

@OmarBerrayti
Last active September 25, 2023 08:42
Show Gist options
  • Save OmarBerrayti/6011088 to your computer and use it in GitHub Desktop.
Save OmarBerrayti/6011088 to your computer and use it in GitHub Desktop.
Book
import urllib
i = 0
pages = 210
while i <= pages:
file = 'page-'+str(i)+'.html'
#link = 'http://siraj.yassine.net/%D8%B3%D9%86%D8%A9-%D8%A7%D9%84%D9%84%D9%87-24/'+file
link = 'http://siraj.yassine.net/books-data/24/'+str(i)+'.html?book=24&page='+str(i)+'&request=&gen=gen'
try:
html = urllib.urlopen(link)
fopn = open(file, 'w+')
fopn.write(html.read())
except :
print 'Cannot'
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment