예제 #1
0
def redirects(page):
    if page.history:
        location = page.history[0].headers['location']
        log(page, 'Redirected to: {0}'.format(location), WARNING)
예제 #2
0
def http_errors(page):
    status = page.status_code
    if status >= 400:
        log(page, 'Status [{0}]'.format(status), ERROR)
예제 #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)