def test_api(self): url = self.get_url("/index.html") site = api.crawl(url) self.assertEqual(11, len(site.pages)) self.assertEqual(1, len(site.error_pages))
def validate_links(url): crawled_site = crawl(url) return crawled_site
from pylinkvalidator.api import crawl crawled_site = crawl("http://www.google.com/") print (crawled_site) number_of_crawled_pages = len(crawled_site.pages) number_of_errors = len(crawled_site.error_pages) print (number_of_errors) print(crawled_site)