linkcheck.htmlutil.linkparse

Find link tags in HTML text.

Functions

find_links(soup, callback, tags)

Parse into content and search for URLs to check.

is_form_get(attr, attrs)

Check if this is a GET form action URL.

is_meta_url(attr, attrs)

Check if the meta attributes contain a URL.

strip_c_comments(text)

Remove C/CSS-style comments from text.

Classes

LinkFinder(callback, tags)

Find HTML links, and apply them to the callback function with the format (url, lineno, column, name, codebase).

class linkcheck.htmlutil.linkparse.LinkFinder(callback, tags)[source]

Bases: object

Find HTML links, and apply them to the callback function with the format (url, lineno, column, name, codebase).

Store content in buffer and initialize URL list.

found_url(url, name, base, lineno, column)[source]

Add newly found URL to queue.

Parse attrs for link name. Return name of link.

html_element(tag, attrs, element_text, lineno, column)[source]

Search for links and store found URLs in a list.

parse_tag(tag, attr, value, name, base, lineno, column)[source]

Add given url data to url list.

Parse into content and search for URLs to check. When a URL is found it is passed to the supplied callback.

linkcheck.htmlutil.linkparse.is_form_get(attr, attrs)[source]

Check if this is a GET form action URL.

linkcheck.htmlutil.linkparse.is_meta_url(attr, attrs)[source]

Check if the meta attributes contain a URL.

linkcheck.htmlutil.linkparse.strip_c_comments(text)[source]

Remove C/CSS-style comments from text. Note that this method also deliberately removes comments inside of strings.