How to use the serpextract.extract function in serpextract

To help you get started, we’ve selected a few serpextract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Parsely / serpextract / tests / test_serps.py View on Github external
def assertInvalidSERP(self, url, **kwargs):
        self.assertIsNone(extract(url, **kwargs))
        self.assertFalse(is_serp(url, **kwargs))
github Parsely / serpextract / tests / test_serps.py View on Github external
def assertValidSERP(self, url, expected_engine_name, expected_keyword, **kwargs):
        # Test both the URL and a parsed URL version
        for url in (url, urlparse(url)):
            res = extract(url, **kwargs)
            self.assertEqual(res.keyword, expected_keyword)
            self.assertEqual(res.engine_name, expected_engine_name)
            self.assertTrue(is_serp(url, **kwargs))