Beispiel #1
0
def redirects(page):
    if page.history:
        location = page.history[0].headers['location']
        log(page, 'Redirected to: {0}'.format(location), WARNING)
Beispiel #2
0
def http_errors(page):
    status = page.status_code
    if status >= 400:
        log(page, 'Status [{0}]'.format(status), ERROR)
Beispiel #3
0
def absolute_links(page):
    for link in page.links:
        if link.startswith(settings.root):
            log(page, 'Absolute internal URL [{0}]'.format(link), WARNING)