Checkers
Wasc contains already defined checkers in chekers.py.
All checkers return "échec" on failure.
Available checkers are listed below with their definition.
AccessCheckerAccessLinkCheckerAccessRateCheckerContactLinkCheckerDoctypeCheckerFooterCheckerHeaderCheckerHeadLvlCheckerHeaderNbCheckerLangCheckerLegalChecker
AccessChecker
- Rule:
"Accessibilité : XX conforme"exists in the page withXXin["non", "partiellement", "totalement"] - Rule: Search in
<footer>, then<div id="footer>, then the whole page - Return:
XX conforme
AccessLinkChecker
- Rule: if
AccessCheckeris valid and it's a link returns it - Rule: if the previous rule fails, check each link in the page looking
accessibilitin the text inside<a> - Rule: if the previous rule fails, check each link in the page looking
accessibilitin thehrefattribute - Return: the link url
AccessRateChecker
- Rule: if
AccessLinkCheckeris valid, get the page from the link. - Rule: the accessibility rate is in a tag containing "conformité" and a floating number directly followed by '%'
- Return: the accessibility rate
ContactLinkChecker
- Rule: Finds
contactorecrirein a link<a>tag - Return: the link url
DoctypeChecker
- Rule: the HTML document contains
<!DOCTYPE html> - Rule:
<!DOCTYPE html>is before<html> - Return:
html
FooterChecker
- Rule: the HTML document contains
<footer> - Return:
présentif the tag is found, elseéchec
HeaderChecker
- Rule: the HTML document contains
<header> - Return:
présentif the tag is found, elseéchec
HeadLvlChecker
- Rule: For each
<head>tags in the page, calculate its depth - Return: the list of depth of
<head>tags
HeaderNbChecker
- Rule: the HTML document contains
<head> - Return: the number of
<head>tags present on the page
LangChecker
- Rule:
<html>has an attributelang - Return: the value of
lang
LegalChecker
- Rule:
"Mentions légales"exists somewhere in the page - Rule:
"Mentions légales"is a link<a>with attributehref - Return: the value of
href