(html_content)
return redirect_link
When the spark proxy returns a warning page with a redirect link, this link has to be parsed
        from the html content.
When the spark proxy returns a warning page with a redirect link, this link has to be parsed
        from the html content.
When the spark proxy returns a warning page with a redirect link this link has to be parsed from the html content .
def _parse_proxy_redirect_url(html_content):
        """When the spark proxy returns a warning page with a redirect link, this link has to be parsed
        from the html content."""
        if not html_content[:6] == "<html>":  # Prevent html parsing of non-html content.
            return None

        soup = BeautifulSoup(html_content, 'html.parser')
        redirect_link = None
        for link in soup.findAll('a'):
            href = link.get('href')
            if 'proxyapproved' in href:
                redirect_link = href
                break

        return redirect_link
def _parse_proxy_redirect_url ( html_content ) : if not html_content [ : 6 ] == "<html>" : # Prevent html parsing of non-html content. return None soup = BeautifulSoup ( html_content , 'html.parser' ) redirect_link = None for link in soup . findAll ( 'a' ) : href = link . get ( 'href' ) if 'proxyapproved' in href : redirect_link = href break return redirect_link