Changing get_page_links function to use list comprehension