View Single Post
Old 10-12-2010, 06:00 PM   #6
TonytheBookworm
Addict
TonytheBookworm is on a distinguished road
 
TonytheBookworm's Avatar
 
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
Quote:

Looks like this will only work in 2010 and will be outdated after 3 months already ?
What about something like

try:
for yy in range(2010,2020):
response = br.follow_link(url_regex='.*?(%d)(\\/)(article(\\/)(print)(\\/)', nr = 0) % yy

(BTW: How do I keep my indentation intact in this online message editor ? If I "preview Post" it disappears. Not exactly what I want when posting Python code.)
yeah i thought about that when writing the code; however i figured who is to say it will be in that format in 2011 so i just kept it the way it was. I figure when 2011 rolls around they will change the site anyway and force us to rewrite the recipe anyway but good thinking on the date range thing.
TonytheBookworm is offline   Reply With Quote