Skip to main content

UrlStatusCrawlerEventListener

Records URLs and their HTTP status codes to a CSV report during a crawl.

Notesโ€‹

Listens for crawler events and records URLs along with their HTTP response status codes to a CSV report file. Useful for generating broken-link reports or auditing status codes returned during a crawl session.

Examplesโ€‹

The following example will generate a broken links report by recording 404 status codes (from HTTP responses).

class: UrlStatusCrawlerEventListener
statusCodes: "404"
outputDir: /report/path
fileNamePrefix: brokenLinks

Usageโ€‹

Full configuration skeleton, with every option and its default
class: UrlStatusCrawlerEventListener
fileNamePrefix: string
outputDir: string
statusCodes: string
timestamped: false

Propertiesโ€‹

PropertyTypeRequiredDefault
fileNamePrefixstringNourlstatuses-
outputDirstringNo-
statusCodesstringNo-
timestampedbooleanNofalse

Property Detailsโ€‹

fileNamePrefixโ€‹

A string prepended to generated file names to distinguish them from other output files.

outputDirโ€‹

The local directory where the URL status report file will be written. Defaults to the crawler working directory.

statusCodesโ€‹

A comma-separated list of HTTP status codes to record. Supports ranges (e.g., 400-499). Default is null, which records all status codes.

timestampedโ€‹

When enabled, a timestamp is appended to the report file name to ensure a new file is created on each crawl run rather than overwriting the previous one.