yes must be 3.6 or newer suggest installing 3.7
you can use an older version, but will have to remove all f-strings, these look like:
Please recognize that this program will create a file of urls where you get the .zips
you can call get_url with each or these to download the zip, and then add a write routine to save as 'page' as mode 'wb'
it would be prettier to add a 'savefile=None' attribute to get_url, if populated save the page to that file, and probably a flag attribute,
default zip=False or mode = 'w' to indicate mode.
example (untested):
you can use an older version, but will have to remove all f-strings, these look like:
url = f'https://www.flightsim.com/vbfs/fslib.php?searchid=65893537&page={pageno}'and can be replaced with:
url = 'https://www.flightsim.com/vbfs/fslib.php?searchid=65893537&page={}'.format(pageno)but f-string is so useful, I'd upgrade (to at least 3.6) for that alone.
Please recognize that this program will create a file of urls where you get the .zips
you can call get_url with each or these to download the zip, and then add a write routine to save as 'page' as mode 'wb'
it would be prettier to add a 'savefile=None' attribute to get_url, if populated save the page to that file, and probably a flag attribute,
default zip=False or mode = 'w' to indicate mode.
example (untested):
def get_url(self, url, savefile=None, mode='w'): page = None response = requests.get(url) if response.status_code == 200: page = response.content if savefile: with savefile.open(mode) as fout: fout.write(page) else: print(f'Cannot load URL: {url}') return page