def visit_loginurl(self):
        """Check for a login URL and visit it."""
        url = self.config["loginurl"]
        if not url:
            return
        user, password = self.config.get_user_password(url)
        session = requests.Session()
        # XXX user-agent header
        # XXX timeout
        response = session.get(url)
        cgiuser = self.config["loginuserfield"]
        cgipassword = self.config["loginpasswordfield"]
        form = formsearch.search_form(response.content, cgiuser, cgipassword,
              encoding=response.encoding)
        form.data[cgiuser] = user
        form.data[cgipassword] = password
        for key, value in self.config["loginextrafields"].items():
            form.data[key] = value
        formurl = urlparse.urljoin(url, form.url)
        response = session.post(formurl, data=form.data)
        self.cookies = session.cookies
        if len(self.cookies) == 0:
            raise LinkCheckerError("No cookies set by login URL %s" % url)
Check for a login URL and visit it.