linkcheck.plugins.syntaxchecks

Functions

check_w3_errors(url_data, xml, w3type)

Add warnings for W3C HTML or CSS errors in xml format.

getXmlText(parent, tag)

Return XML content of given tag in parent element.

Classes

CssSyntaxCheck(config)

Check the syntax of CSS stylesheets with the online W3C CSS validator.

HtmlSyntaxCheck(config)

Check the syntax of HTML pages with the online W3C HTML validator.

W3Timer()

Ensure W3C apis are not hammered.

class linkcheck.plugins.syntaxchecks.CssSyntaxCheck(config)[source]

Bases: _ContentPlugin

Check the syntax of CSS stylesheets with the online W3C CSS validator. See https://jigsaw.w3.org/css-validator/manual.html#expert.

Initialize plugin.

applies_to(url_data)[source]

Check for CSS, extern and session.

check(url_data)[source]

Check CSS syntax of given URL.

class linkcheck.plugins.syntaxchecks.HtmlSyntaxCheck(config)[source]

Bases: _ContentPlugin

Check the syntax of HTML pages with the online W3C HTML validator. See https://validator.w3.org/docs/api.html.

Initialize plugin.

applies_to(url_data)[source]

Check for HTML, extern and session.

check(url_data)[source]

Check HTML syntax of given URL.

class linkcheck.plugins.syntaxchecks.W3Timer[source]

Bases: object

Ensure W3C apis are not hammered.

Remember last API call.

check_w3_time(**kwargs)[source]

Make sure the W3C validators are at most called once a second.

SleepSeconds = 2
linkcheck.plugins.syntaxchecks.check_w3_errors(url_data, xml, w3type)[source]

Add warnings for W3C HTML or CSS errors in xml format. w3type is either “W3C HTML” or “W3C CSS”.

linkcheck.plugins.syntaxchecks.getXmlText(parent, tag)[source]

Return XML content of given tag in parent element.