def get_subpages(stub):
 ignore_chars = ['/', '?']
 image_chars = ['.jpg', '.png']
 confs = {}
 images = []
 subs = []
 r = requests.get(URL_BASE)
 t = r.text
 subs_raw = [x[:x.index('"')] for x in t.split('<a href="') if ('"' in x)]
 for sub in subs_raw:
  for ig in ignore_chars:
   if (ig in sub):
    break
  else:
   subs.append(sub)
 for sub in subs:
  for img in image_chars:
   if (img in sub):
    images.append(sub)
    break
  else:
   confs[sub] = None
 for image in images:
  cnf = image.replace('.png', '').replace('.jpg')
  if (cnf in confs):
   confs[cnf] = image
 return confs

def get_subpages ( stub ) : ignore_chars = [ '/' , '?' ] image_chars = [ '.jpg' , '.png' ] confs = { } images = [ ] subs = [ ] r = requests . get ( URL_BASE ) t = r . text subs_raw = [ x [ : x . index ( '"' ) ] for x in t . split ( '<a href="' ) if ( '"' in x ) ] for sub in subs_raw : for ig in ignore_chars : if ( ig in sub ) : break else : subs . append ( sub ) for sub in subs : for img in image_chars : if ( img in sub ) : images . append ( sub ) break else : confs [ sub ] = None for image in images : cnf = image . replace ( '.png' , '' ) . replace ( '.jpg' ) if ( cnf in confs ) : confs [ cnf ] = image return confs
returns a dictionary of conf files found in the sub-menu along with images if there are any .