def create_scraper(cls, sess=None, **kwargs):
        """
        Convenience function for creating a ready-to-go CloudflareScraper object.
        """
        scraper = cls(**kwargs)

        if sess:
            attrs = ["auth", "cert", "cookies", "headers", "hooks", "params", "proxies", "data"]
            for attr in attrs:
                val = getattr(sess, attr, None)
                if val:
                    setattr(scraper, attr, val)

        return scraper
def create_scraper ( cls , sess = None , ** kwargs ) : scraper = cls ( ** kwargs ) if sess : attrs = [ "auth" , "cert" , "cookies" , "headers" , "hooks" , "params" , "proxies" , "data" ] for attr in attrs : val = getattr ( sess , attr , None ) if val : setattr ( scraper , attr , val ) return scraper
Convenience function for creating a ready-to-go CloudflareScraper object.