linkcheck.plugins.regexcheck

Check page content with regular expression.

Classes

RegexCheck(config)

Define a regular expression which prints a warning if it matches any content of the checked link.

class linkcheck.plugins.regexcheck.RegexCheck(config)[source]

Bases: _ContentPlugin

Define a regular expression which prints a warning if it matches any content of the checked link. This applies only to valid pages, so we can get their content.

Use this to check for pages that contain some form of error message, for example ‘This page has moved’ or ‘Oracle Application error’.

Note that multiple values can be combined in the regular expression, for example “(This page has moved|Oracle Application error)”.

Set warning regex from config.

applies_to(url_data)[source]

Check for warningregex, extern flag and parseability.

check(url_data)[source]

Check content.

classmethod read_config(configparser)[source]

Read configuration file options.