示例#1
0
    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))
示例#2
0
def validate_links(url):
    crawled_site = crawl(url)
    return crawled_site
示例#3
0
    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))
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)