an class="code-comment"># Return soup object if successful</span>
            return BeautifulSoup(response.text, 'html.parser')
            
        except requests.RequestException as e:
            print(f"Error scraping {url}: {e}")
            retries += 1
            <span class="code-comment"># Exponential backoff</span>
            time.sleep(2 ** retries)
    
    <span class="code-comment"># If all retries fail</span>
    print(f"Failed to scrape {url} after {max_retries} attempts")
    return Non