javascript - How to make a page loop script -


is there can make script download multiple pages, instead of 1 single page?

this script in python:

import json, urllib  page_data = urllib.urlopen("http://example.com/wp-content/themes/example/html5system/request/example-8/get/1/").read() js = json.loads(page_data) #print js['page']  open('page1.svg', 'wb') f_out:     f_out.write(js['page'].encode('utf-8'))   

import json, urllib  in range(1,301): # loop 1 300     page_data = urllib.urlopen("http://example.com/wp-content/themes/example/html5system/request/example-8/get/%d/" % i).read()     js = json.loads(page_data)      open('page%d.svg' % i, 'wb') f_out: # save each page in separate svg         f_out.write(js['page'].encode('utf-8'))         f_out.close() 

i added simple loop around existing code runs numbers 1 300. did string replacement '%d' % i inserts value of i %d located in string. did same thing file name, each page saved separate .svg file.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -