Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- lines = list(csv.reader(open('data/data.csv')))[1]
- template_data = open('data/template.html').read()
- for line in lines:
- if not line:
- continue
- print line
- filename = 'outputs/{}.html'.format(line[1].replace(' ', '_'))
- filename_data = template_data.replace('[URL]', line[0])
- open(filename, 'w').write(filename_data)
- ## data.csv with headers URL,Keyword
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="Refresh" content="0; URL=[URL]">
- mysite.com,keywword
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement