 <p>It is a good way, but. You should not use just <code>except</code> clause, you have to specify the type of the exception you are trying to catch. Also you can catch an error and continue the loop.</p> <pre><code>def scrape_all_pages(alphabet): try: pages = get_all_urls(alphabet) except IndexError: #IndexError is an example ## LOG THE ERROR IF THAT FAILS. for page in pages: try: scrape_table(page) except IndexError: # IndexError is an example ## LOG THE ERROR IF THAT FAILS and continue this loop </code></pre>