---
title: "htmldate — paper by Barbaresi (2020) — summary and ideas"
description: "htmldate finds publication and update dates in web pages, and its benchmark shows how a broader search changes coverage and accuracy."
canonical: "https://research.elamur.ai/free/en/papers/barbaresi-2020-htmldate-python-package-extract-publication/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/barbaresi-2020-htmldate-python-package-extract-publication/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2020](https://md.research.elamur.ai/free/en/papers/2020/) / htmldate: A Python package to extract publication dates from web pages

# htmldate: A Python package to extract publication dates from web pages

Paper · 2020 · Adrien Barbaresi

**Authors:** [Adrien Barbaresi](https://md.research.elamur.ai/free/en/authors/adrien-barbaresi/) · **Year:** 2020 · **Venue:** The Journal of Open Source Software · **Licence:** [CC BY (OpenAlex best open-access location)](https://creativecommons.org/licenses/by/4.0/)

The Journal of Open Source Software · [licence](https://creativecommons.org/licenses/by/4.0/)

- [PDF](https://joss.theoj.org/papers/10.21105/joss.02439.pdf)
- [DOI 10.21105/joss.02439](https://doi.org/10.21105/joss.02439)

## Summary

A webpage can contain several dates and still be difficult to place in time. The date an article first appeared may be stored in its HTML header, displayed near its title, or mixed with dates that belong to other material. A separate date may indicate when the article was last revised. Adrien Barbaresi presents htmldate, a Python package that searches for evidence of either event. The distinction matters for researchers who build collections of web texts. A passage can document how a word was used, but its value as evidence about when that usage occurred depends on how reliably the document can be dated.

The package starts with clues whose location or markup suggests what they mean. It examines metadata in the header, looks for elements and attributes associated with dates elsewhere in the document, and can search the remaining markup and text. Its fast configuration looks for specific patterns in cleaned HTML. Its extensive configuration collects a wider range of possible dates and tries to choose among them. By default, the package seeks the original publication date. It can also seek the last update date, and returns `None` if it cannot find a cue it judges suitable.

The paper compares the configurations with other Python packages on 225 webpages with identifiable dates. The sample includes ordinary articles and harder cases and draws mainly from German web collections. On that benchmark, htmldate’s fast configuration records precision of 0.903, recall of 0.907 and accuracy of 0.827. The extensive configuration records precision of 0.889, recall of 1.000 and accuracy of 0.889. Both configurations score higher on accuracy than the other packages in the comparison. The extensive configuration returns dates more broadly, while the fast configuration is more frequently correct when it gives an answer.

The comparison shows why a date extractor needs to be judged both on the answers it supplies and on the documents it leaves undated. The extensive configuration’s recall score accompanies an accuracy score below perfect agreement with the reference dates. The two configurations also differ in their installed components, so their results describe the behavior of complete setups. The benchmark measures performance on pages selected for having a determinable date. It leaves open how frequently the package would correctly leave an undatable page unanswered in a broad crawl.

## Deep dive: htmldate: A Python package to extract publication dates from web pages

htmldate finds publication and update dates in web pages, and its benchmark shows how a broader search changes coverage and accuracy. · about 31 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Finding an event in a document

Dating a webpage sounds like a matter of reading a field. Frequently the first information available to a crawler is the page address and the response from the server. Barbaresi regards those sources as unreliable ways to establish when the document was published or changed. The information may be recoverable from the page, but some inspection is needed before a program can use it. The research problem is how to perform that inspection repeatedly across a collection whose publishers follow different conventions.

A date has to be attached to an event to be useful. A statement about original publication helps place a document at the time it entered circulation. A statement about the last update tells the reader something about the history of the copy being examined. A document can supply evidence for both. A program that simply records the first recognizable date gives its user no assurance about which event it has recorded. Calendar interpretation and interpretation of the date’s role are separate parts of the task.

The same distinction applies to dates that occur in the article itself. An article can describe an earlier event in considerable detail, including the day it happened. That day belongs to the subject of the article. The publication date belongs to the article as a document. To a search pattern looking only at the characters that make up the date, the two can look alike. The page’s structure, surrounding words, or conventions used by its publishing system may give a program grounds for distinguishing them. Some of those grounds are stronger than others.

The paper treats differences between publishers as a regular feature of web data collection. Pages vary with their genres, platforms, content management systems and publication goals. A news outlet, an independent blog and a site built for some other purpose may all include dates, with different choices about where those dates appear and how they are represented. A rule tailored to one publisher’s HTML can succeed repeatedly there and contribute little to extracting dates across sites. A broad collection makes those differences part of the routine workload.

This places page dating within [information extraction](https://md.research.elamur.ai/free/en/concepts/information-extraction/), the task of recovering specific fields from documents in a form that software can use. Here the field is small enough to store as a date string, but the evidence for its value extends from machine-oriented metadata to prose intended for readers. A common output format is useful only after the program has decided which piece of evidence the field should represent. Standardizing a date copied from the wrong part of a page would make the mistake easier for later software to process.

#### Why dates matter in a research collection

The immediate setting for htmldate is the construction of web text collections for linguistic research. Barbaresi describes work connected with a lexicographic platform at the Berlin-Brandenburg Academy of Sciences. The platform provides access to web corpora enriched with metadata. A corpus in this setting is a collection of documents that can be searched and studied together. Metadata adds information about each document that helps a researcher interpret the passages found during a search. The work connects the study of words through [lexicography](https://md.research.elamur.ai/free/en/concepts/lexicography/) with the use of text collections in [corpus linguistics](https://md.research.elamur.ai/free/en/concepts/corpus-linguistics/).

A dated occurrence of a word answers a different question from an occurrence whose timing is unknown. If a lexicographer wants to trace usage through time, the date helps place the passage among other observations. An early dated occurrence can be evidence that a use already existed at that point. The argument depends on what the date describes. A later revision can incorporate material written after the page originally appeared. An original publication date identifies the page’s first appearance, while the update date can be relevant to interpreting the version from which the passage was taken. The availability of both fields is therefore more useful than a general instruction to attach any plausible day to the text.

The paper places extraction inside a longer process for creating an offline corpus from the web. A collection starts with decisions about what to crawl and download. The acquired pages then have to be cleaned and checked for duplication. Linguistic labels can be added before the material is loaded into a system for searching the corpus. The resulting collection is available apart from the live sites from which it came. A person searching it may encounter a passage in that processed setting, where the source page’s visual presentation is no longer available to explain a date’s role.

A broad crawl supplies volume but also leaves researchers with questions about what they have collected. The paper describes earlier corpus builders as having to assess focus, suitability and quality after collecting material. Web collections can also lack the descriptive metadata that readers would need for more focused inquiries. Extracting dates addresses one part of that problem. It makes time available as a dimension along which a collection can be described or queried, provided the dates are tied to the intended events. It also gives a collection builder a basis for recognizing pages whose date evidence falls short of the collection’s requirements.

Barbaresi describes a tension between collecting opportunistically and collecting with tighter controls. The more widely a crawler ranges, the more kinds of pages its processing must handle. A narrow selection can simplify extraction but shapes which published material the corpus contains. Missing dates matter in that setting because a requirement for dated pages can affect the eventual composition of the collection. For instance, if a method works primarily on sites with familiar publishing templates, documents that use unfamiliar templates can be harder to retain in a dated collection. The paper’s interest in smaller outlets and blogs follows from this practical problem.

Dates also matter to systems that manage access to web material. The paper associates update information with decisions about bandwidth and mentions metadata in connection with indexing and caches. A program that knows when content changed has information relevant to keeping a stored copy current. A researcher who wants to place an article historically is asking for a different event. The two uses explain why the package offers a choice between original publication and last update even though both choices have the same basic output form.

#### The approaches already available

The paper describes examination of the Document Object Model, or DOM, as a common way to extract information from HTML. The DOM represents a document as a tree of elements. A program can inspect a particular portion of that tree or look through it for elements and attributes of interest. In a dating task, tree structure can preserve distinctions that disappear when a page is reduced to a single line of text. A string in the header can have a different evidential role from the same string inside a paragraph.

Pattern matching offers another route. A regular expression describes a pattern of characters that can be searched for in text. It can help locate a string with the shape of a date or search for a recognizable convention in the HTML. As the paper points out, a search that inspects less of the document structure offers no automatic guarantee of faster processing. For dates, there is also a question of what a match establishes. A textual pattern may establish that a plausible date occurs somewhere. The extractor still needs a basis for deciding whether that date concerns the page’s publication or modification.

The existing Python packages included both specialized and broader systems. According to the paper, articleDateExtractor finds when a web article or blog post was published and converts the date to a standard format. It presents date_guesser as a publication-date extractor that can accompany its answer with an assessment of its accuracy. The description of newspaper emphasizes news texts. Goose3 can retrieve information associated with embedded content, and news-please combines crawling with the extraction of structured information from news. Their different purposes matter when comparing the cost of invoking them for a task that needs only a date.

The paper also identifies routes outside the comparison. Datefinder searches for dates in text using patterns for [English](https://md.research.elamur.ai/free/en/topics/english/). CarbonDate is discussed as a possible way to estimate the age of a web resource when the page supplies no usable date, with a substantial computational cost. These alternatives help define the boundaries of the problem htmldate addresses. Finding dates in prose is a source of candidates. Estimating age when a page lacks cues is a different way of obtaining evidence. Htmldate looks inside the document for recognizable reasons to associate a date with publication or updating.

The package also draws on patterns associated with existing extraction software. The paper credits python-goose and metascraper among those sources, along with newspaper and articleDateExtractor. The relationship to earlier work is therefore visible in the method itself. Common practices in web publishing already gave extractors clues to look for. Htmldate brings several kinds of clues into one search that can continue when an initial approach yields too little information. Its design addresses the number of forms in which a date may be expressed as well as the need to decide whether a recognized expression is a suitable answer.

### The method, step by step

#### What goes in and what comes out

Htmldate accepts a web address, an HTML file or an HTML tree. Those inputs correspond to different points in a web-processing workflow. With an address, the package can handle downloading the page. A file accommodates material that has already been retrieved. A tree allows another part of a program to supply the structure after parsing the HTML. The paper presents these routes as interfaces to the same dating operation. It also describes use from Python and from the command line, including processing documents in batches.

The requested date is part of the setup. The normal request is for original publication. A caller can switch to last update. This choice has a semantic effect even though the result in either case is a string. A date associated with a revision can be exactly the value a caller requested on one invocation and unsuitable on another. An appropriate cue has to support the relevant event. The paper describes checks for whether the output is plausible and suitable, and `None` is available when no valid cue can be found.

The default output uses the year, month and day order of ISO 8601. A caller can ask for a desired format. It is useful to distinguish the work involved in obtaining that string from the work involved in choosing it. Extraction locates the source material. Interpretation identifies the date it expresses. Selection decides whether that expression supports the requested date for the document. Formatting presents the chosen day in the expected form. The article describes a heuristic extraction process and gives no mathematical formula for the candidate decision.

How htmldate searches for a page date The steps in order.

#### Begin with the header

The first source of evidence is the HTML header, where publishing software can put information about the page for other programs to read. Htmldate looks for familiar patterns in elements such as `meta` and `link`. Its rules include conventions associated with the Open Graph protocol as well as conventions particular to content management systems. A content management system is the software a publisher uses to organize and deliver its pages. If it consistently puts a publication field in the header, that field gives an extractor a way to attach meaning to the value stored there.

The location of a date and the name of the field work together. A date in a clearly identified publication field comes with an explanation of the event to which it belongs. A date with the same calendar value can appear in a less informative location, where the program has to infer its relationship to the page. Searching the header first lets the extractor look for the kind of cue that already carries much of the interpretation needed for the task. It can also find a date even when the publisher chooses an unusual way of displaying it to readers.

The use of common conventions and site software conventions addresses different kinds of variation. A common protocol gives unrelated publishers a shared way of expressing metadata. Conventions associated with specific publishing software can be productive across sites that use that software, even when those sites do not express the field in a common protocol. In both cases the extractor looks for a known relationship between a field and a date. The set of patterns determines which relationships the program can recognize. The paper explains these classes of patterns without enumerating the header rules or giving an ordering for every possible combination.

The header stage also illustrates what Barbaresi means when describing markup-based extraction as multilingual. A machine-oriented field can have the same role on pages whose article text is written in different languages. The program can recognize the markup convention without reading the surrounding article. This property concerns the form of the evidence. It still depends on publishers supplying metadata that the extractor understands, and on the values being suitable for the requested purpose.

#### Search for structural clues throughout the document

The next search uses structural markers beyond the initial header inspection. The paper names `abbr` and `time` elements, along with attributes such as `postmetadata`. An attribute is a property attached to an HTML element, so it can identify something about the element’s content or role. A publishing template can use such a marker to distinguish metadata around an article from the article’s paragraphs. Traversing the tree gives the program an opportunity to find that information even if the page has little useful metadata in its header.

An element that marks a time supplies a different clue from an element whose attributes associate it with post metadata. In the first case, the element itself identifies a temporal expression. In the second, its association with a post helps locate material near the document’s descriptive fields. Neither kind of marker, just by existing, settles which day should be returned. A document can contain a marked date that belongs to its subject, and a metadata area can contain information about different events. The extractor uses these markers as places to look for relevant values, within a request that already specifies the kind of date wanted.

This stage shows why a tree and a pattern search can complement each other. Searching a tree helps identify where a date occurs in the document and what surrounds it in the markup. Pattern matching can then help recognize the expression at that location. A processor using only visible words has access to some of the same information that a reader sees, but loses machine-oriented labels that may be crucial to interpreting those words. A processor using only a narrow set of metadata fields can miss dates that a reader would readily find in the page. Htmldate uses structure first and then widens its search to other evidence.

The distinction between the header and the entire tree is about the places inspected and the types of signals sought there. Both can rely on knowledge of publishing conventions. An explicit field in the header and a familiar attribute around a date in the body can both tell the extractor something about the expression it has found. The paper describes a progression from one class of evidence to another. It leaves the detailed control flow, including how every competing structured cue is resolved, to the implementation.

#### Look in the remaining markup and text

Pages can still give a human reader recognizable evidence when their structured fields are sparse. A publisher might present a publication statement in ordinary text or use markup under a convention that the earlier search did not recognize. Htmldate therefore includes a stage that applies heuristics to the page’s HTML and text. A heuristic is a rule that uses a useful clue to guide a decision in cases where a general solution is unavailable. Here the clue may be a precise textual pattern or the presence of a date expression among other likely candidates.

In fast mode the package cleans the HTML and targets precise patterns. The paper gives the general strategy without listing which parts of the page are removed in cleaning or spelling out the complete set of patterns. The mode restricts what it treats as worth pursuing in this stage. If a page expresses its date in a way the patterns recognize, the extractor has a reasonably specific cue to work with. If the page expresses the date in an unexpected way, the search may end without an answer even when a person reading the page could find one.

Extensive mode widens that search. It collects potential dates and uses a disambiguation procedure to select the best candidate it can find. Disambiguation here means deciding among several plausible readings of the document’s date evidence. It begins with expressions that might be useful and ends with a choice about which one, if any, can answer the request. A page mentioning past events, containing both a publication field and a revision field, or repeating a date in different parts of its markup illustrates the kinds of ambiguity the search can face. These situations explain why collecting more candidates creates work for the selection step.

The benefit of wider collection depends on where the relevant clue was lost in the fast configuration. If a page’s useful date fell outside the precise patterns, collecting more candidates gives the extractor a chance to see it. If the date was already available and the extra candidates are irrelevant, the wider search gives the decision procedure more competing material. The paper describes the intended breadth of extensive mode. It does not specify a numerical score for each candidate, a complete system of preferences among date expressions, or a tie-breaking rule that can be applied from the article alone.

Text-based refinements support German, English and Turkish in the version described. These refinements make use of linguistic patterns and supplement the structurally defined search. German is particularly relevant to the corpus setting the paper describes. Language can matter when a date is expressed through words or appears in a phrase that helps explain its role. The same numerical value may be understandable across pages, but the words that identify it as a publication or update date can differ. The package’s coverage therefore depends in part on which kind of cue a page makes available.

#### Check the answer and handle missing evidence

At the end of the search, the selected date must pass checks for plausibility and suitability. Plausibility concerns whether the result is a defensible date. Suitability concerns whether the cue can serve as evidence of the event the caller asked about. The paper uses both ideas to characterize verification but gives no full specification of the checks. In particular, it does not identify thresholds or enumerate all circumstances in which a candidate will be rejected. The method can be described at the level of its stages without ascribing undocumented tests to them.

There are several ways a page can lead to `None`. It may lack any useful date evidence. It may contain an intelligible date under a convention the package fails to recognize. It may yield a candidate that fails verification. The returned value represents the outcome of the extractor’s search and checks. The paper describes no separate output identifying which explanation applies. In a corpus, the absence of an extracted date is therefore an observation about both the document and the method used to inspect it.

The same point applies when the package supplies a day. Formatting makes that day easy for another program to store and compare. The stated format does not convey the source of the evidence or its strength. The behavior presented in the paper is a date string or `None`. That simple result suits batch processing, where a researcher can ask the same question of many documents, but the benchmark has to evaluate agreement with reference dates to say how frequently the result is right. The normal appearance of the output is a property of formatting.

#### Rules, optional components and data

The method is presented as a system of heuristics. The paper reports no procedure that learns the header rules, the text patterns or the candidate preferences from labeled pages. It describes the document collection later in the article as the data for comparing extractors. The package’s behavior comes from the supplied rules and the components it uses to inspect HTML and interpret dates. Among the dependencies that aided the work, the paper names `lxml`, `ciso8601` and `dateparser`.

The distinction between search modes is only part of what changes across the two reported setups. The extensive benchmark entry uses the package with its optional `all` components. Barbaresi explains that those components can affect coverage through further linguistic processing and may also affect speed through faster date parsing. The implementation choices thus concern both the set of cues the program can interpret and the machinery with which it handles them. A larger search can take more work, while a faster component can reduce the time required for some operations inside that search.

For a reader trying to reproduce the comparison, the annotations on the two configurations carry real meaning. Both use release 0.7.0, but the test compares the fast setup under the ordinary package name with the extensive setup under `htmldate[all]`. The mode controls how the text and markup are searched in the stage that follows structured extraction. The package option controls which additional components are available. The experiment records the result of those choices together. That distinction is important when moving from an explanation of the method to an explanation of the observed scores.

### Experiments and results

#### The documents and the reference dates

The benchmark consists of 225 pages whose dates could be identified. These were selected from large German web collections. The paper includes both familiar Internet articles and documents it describes as atypical and more difficult to process. News outlets and blogs appear in the sample, including smaller publishers. The author also includes a few pages from additional language settings, naming English, other European languages, Chinese and Arabic.

This selection provides a variety of presentation and markup conditions while keeping a definite reference for evaluation. The relevant distinction is between a date that is determinable for the benchmark and a date that is readily accessible to a particular extractor. A page can belong in the test because there is enough evidence to decide its date, yet defeat a program that searches in the wrong places or recognizes too few patterns. Such a page tests the extractor’s reach. An output of `None` on it is a missed date under the benchmark’s inclusion rule.

Each reference is evaluated at the day level. Where necessary, program outputs are converted to `%Y-%m-%d`, a format with the year followed by the month and day. Normalization allows an output to be compared with the reference even if the package originally expressed it differently. It also fixes the meaning of agreement for the evaluation. If a package returns the wrong calendar day, superficial agreement in formatting does not make the prediction correct. If two packages express the right day in different forms that can be normalized, the original differences in presentation do not prevent a match.

The project includes the evaluation script `tests/comparison.py` and places the test material in its tests directory. The paper describes the comparison as reproducible with the project files and the required packages. The script and data matter because the article reports aggregate scores. They provide the route to the experimental procedure behind the table, including the conversion from each package’s native output into the item the benchmark compares.

#### The systems and the measures

The table compares newspaper 0.2.8, goose3 3.1.6 and date_guesser 2.1.4. It also includes news-please 1.5.3 and articleDateExtractor 0.20. The htmldate entries are the fast and extensive configurations of release 0.7.0. These systems share enough functionality to be compared on a question about document dates. They vary in their intended workload, which makes a separate distinction necessary for timing. A news crawler or a general article extractor may undertake work that a date-specific package has little reason to perform.

The paper reports precision, recall, accuracy, F-score and time. Its explanation of precision focuses on the correctness of the dates a package supplies. This view is useful when a reader wants to know how much trust to place in the presence of an answer. Recall describes the reach of the extractor in the benchmark’s reporting. Accuracy measures agreement on the test while reflecting the impact of absent answers. The paper presents recall and accuracy as useful accounts of performance because an extractor that stays silent on many pages presents a different practical outcome from one that produces dates widely.

The table also gives an F-score, a combined measure of precision and recall. That score summarizes a tradeoff, but its value cannot indicate on its own which of the two quantities accounts for a system’s position in the comparison. An extractor that answers a limited group of pages correctly can have high precision and a much lower F-score if its recall is poor. The article gives the tabulated measures and discusses the role of absent answers. It supplies no equations specifying all the underlying counts and how error cases enter each measure.

It helps to consider what the measures observe when an extractor processes a page. A returned date can match the reference or disagree with it, and the extractor can fail to give a usable date. Agreement is necessary for a correct answer. Giving an answer at all is relevant to reach. Discarded outputs and processing exceptions can complicate the accounting, especially when packages return different kinds of objects or fail in different ways. The paper mentions such cases for goose3 and news-please, so the reported scores are best read as the outcomes of the benchmark’s program and data.

#### Coverage and correct dates

The contrast in recall is pronounced. Newspaper has recall of 0.407, and goose3 has recall of 0.441 on the benchmark. News-please has the highest recall among the alternatives at 0.660, with articleDateExtractor at 0.635 and date_guesser at 0.553. Fast htmldate reports recall of 0.907, and extensive htmldate reports 1.000. The higher scores show that the htmldate configurations extend further across these datable pages under the benchmark’s treatment of missing output.

Recall of Python date extractors on the web-page benchmark Extensive htmldate reaches furthest across the datable pages, followed by fast htmldate.

**The numbers**

| System or setting | Recall |
| --- | --- |
| newspaper | 0.407 |
| goose3 | 0.441 |
| date_guesser | 0.553 |
| news-please | 0.660 |
| articleDateExtractor | 0.635 |
| htmldate fast | 0.907 |
| htmldate extensive (this paper) | 1.000 |

Precision tells a different story about several of the same systems. Newspaper reports precision of 0.888 and goose3 reports 0.887. The paper calls attention to how well these systems perform on this measure in spite of leaving many pages without a date. News-please reports precision of 0.823. The precision of articleDateExtractor is 0.817, and that of date_guesser is 0.809. Extensive htmldate has precision of 0.889, while fast htmldate leads the comparison on precision with 0.903. Finding an advantage for extensive search depends on counting what happens across the collection as well as examining the trustworthiness of the dates it returns.

On accuracy, extensive htmldate leads with 0.889, followed by fast htmldate with 0.827. The leading alternative on that metric is news-please at 0.578. ArticleDateExtractor records accuracy of 0.556 and date_guesser records 0.489. Goose3 and newspaper have accuracy of 0.418 and 0.387, respectively. The difference between date_guesser and newspaper is consistent, the paper says, with comparisons reported by the project behind date_guesser. Within this test, the separation between precision and accuracy for goose3 and newspaper is evidence of how much their missing outputs matter to collection-level performance.

Day-level accuracy of Python date extractors on the web-page benchmark Both htmldate configurations achieve higher accuracy than the comparison packages, with extensive htmldate in front.

**The numbers**

| System or setting | Accuracy |
| --- | --- |
| newspaper | 0.387 |
| goose3 | 0.418 |
| date_guesser | 0.489 |
| news-please | 0.578 |
| articleDateExtractor | 0.556 |
| htmldate fast | 0.827 |
| htmldate extensive (this paper) | 0.889 |

The extensive configuration’s recall of 1.000 needs to be read alongside its accuracy of 0.889. The recall value describes the extent of extraction under the benchmark’s reporting. The accuracy value shows that the extracted dates still include departures from the day used as the reference. This is an important distinction for a corpus with a date column. A field that is widely populated has an advantage for searches that depend on that field. The reliability of individual time assignments is a separate part of the evaluation.

The F-scores preserve the lead of the extensive configuration, which records 0.941 against 0.905 for the fast configuration. News-please has the highest F-score among the comparison packages at 0.732. ArticleDateExtractor follows at 0.714. Date_guesser reports 0.657, goose3 reports 0.589 and newspaper reports 0.558. The ranking on this combined measure reflects the balance reported for the test. The precision figures remain important when deciding how to interpret that balance, since fast htmldate and extensive htmldate occupy different positions on the two components.

F-score of Python date extractors on the web-page benchmark Extensive htmldate leads the combined measure, and fast htmldate also ranks above every comparison package.

**The numbers**

| System or setting | F-score |
| --- | --- |
| newspaper | 0.558 |
| goose3 | 0.589 |
| date_guesser | 0.657 |
| news-please | 0.732 |
| articleDateExtractor | 0.714 |
| htmldate fast | 0.905 |
| htmldate extensive (this paper) | 0.941 |

#### Running time and awkward outputs

For time, the paper reports the best of 3 runs. Fast htmldate has a time entry of 2.4 and extensive htmldate an entry of 3.8. ArticleDateExtractor’s entry is 6.8, and date_guesser’s is 40.0. Barbaresi emphasizes these comparisons because the latter two packages are treated as the closest in workload to a specialized date extractor. In the other entries, the reported times are 15.5 for goose3, 69.6 for news-please and 81.6 for newspaper. The table gives these as time values without labeling the unit.

The timing comparison answers a practical question about the reported setups processing the benchmark. It combines any work the measured package performs during that operation. Barbaresi cautions that some packages undertake a series of operations irrelevant to the dating task. Their runtime entries consequently reflect a broader workload. Reporting the best run gives the reader the observed ordering under that reporting rule. It leaves the variation among runs and the cost of individual extraction stages unspecified.

The paper also describes difficulties in turning all package outputs into comparable dates. Some goose3 results were judged unsuitable because they lacked a meaningful or standardized form, and those results were discarded. The author reports that news-please can raise an exception on some encodings, with Chinese material given as an example. These observations concern practical processing as well as the interpretation of a date. In batch work, a package has to reach the point of returning an interpretable result before its choice of day can be evaluated.

Barbaresi highlights improved coverage for smaller news outlets, blogs and other websites, and for pages outside English, especially German in this sample. Those are the kinds of pages that motivated a broader set of extraction rules. The benchmark’s numerical evidence is reported across the whole collection. It gives a comparison of extractors on a mix of pages, with qualitative observations about where coverage improved. It does not provide a separate score for each kind of site or language, so the aggregate results carry the main quantitative claim.

### What the ablations show

The paper presents no ablation that removes a single component while holding the rest fixed, and instead analyzes the tradeoff between the fast and extensive configurations, the contrast between coverage and correctness, and practical differences in runtime and output.

#### What changes with the configuration

The fast and extensive configurations are the nearest thing to a controlled comparison because they belong to the same package release and run on the same set of datable pages. The extensive configuration searches more broadly and also uses the optional components. Its higher recall is consistent with an extractor that considers dates that a narrow pattern search can pass over. Its lower precision is consistent with a wider candidate set giving the system more opportunities to select a date that does not match the reference. The observed pattern supports the description of the two complete setups. The article does not track individual answers to establish which mechanism produced each change.

There are several distinct stages at which the extensive setup could gain coverage. It could discover a date expression the fast patterns never locate. It could be able to interpret an expression because of additional linguistic processing. It could have several expressions available and prefer a different one through its disambiguation procedure. The setup difference allows all of those possibilities. The comparison gives the joint result and leaves their individual contributions undetermined. This is particularly important when interpreting the use of optional components, which the paper connects to both further analysis of dates and possible changes in parsing speed.

The aggregate numbers also leave open which pages appear in the sets of correct answers for each configuration. Higher accuracy for extensive htmldate establishes the better overall outcome for the benchmark. A page-level account would be needed to tell whether extensive search mainly succeeds on pages the fast mode leaves blank, whether it corrects dates that fast mode gets wrong, or whether it also changes some correct fast answers to wrong ones. Those patterns would describe different interactions between candidate generation and selection. The table supports the aggregate comparison without a breakdown of those interactions.

#### What the alternatives reveal about the measures

Newspaper and goose3 give the clearest examples of why precision alone is insufficient for describing the benchmark. The author singles out their comparatively high precision and poor recall. The pages on which they do return usable dates show that both can make correct selections. Their coverage scores show how limited that success is across a collection whose inclusion criteria already require a determinable date. This comparison explains why a researcher building a corpus may care as much about the blank dates as about the reliability of the dates already filled in.

The two htmldate configurations give a related analysis within one package. The fast setup leads on precision, while the extensive setup leads on recall, accuracy and F-score. Its position on the combined and collection-level measures shows the effect of evaluating a broader share of the collection. For a researcher reading the benchmark, the choice of measure determines which behavior is being emphasized. A measure focused on returned dates evaluates the reliability of answers that are present. A measure sensitive to missing outputs also reflects how often an extractor makes a page available for a date-dependent use.

The reporting on runtime and output adds observational evidence about the interfaces through which these systems are used. An exception, a hard-to-standardize date and an absent date are different events during processing. Each can leave the caller without a usable value. The paper identifies examples of the first two for particular packages and discusses missing outputs through recall and accuracy. This gives the comparison a more concrete meaning than a ranking alone, while leaving the frequency of each kind of failure and the individual cost of each processing step open.

### Limitations

#### Limits the paper states

Barbaresi limits the evaluation to documents with dates that can be clearly determined. That choice makes day-level reference answers possible and also determines what the coverage scores mean. They concern pages where usable dating evidence exists for the benchmark. The sample draws heavily on German webpages, with a handful of documents from other language settings. The paper describes markup extraction as multilingual because the same structural cues can appear across languages. It identifies German, English and Turkish as the languages given text-based refinements. The sample and the language support are two distinct conditions on the results.

The paper also limits how the time entries should be interpreted. Some alternatives perform operations beyond the requested dating task, and the chosen value is the best of 3 runs. The author singles out articleDateExtractor and date_guesser for the closer comparisons. There are also conditions on what is counted as usable output. The paper reports discarding some goose3 outputs and observes an encoding-related problem in news-please. These details matter to anyone treating the results as a comparison of complete programs, because reaching a standardized date is part of the observed behavior.

Barbaresi describes the method as relying on heuristics and recognizes that the task still requires guesses. The evidence available on a page can be incomplete or ambiguous, even for a tool that knows a wide range of HTML conventions. The package can return `None` after seeking a suitable signal, and the extensive setup gives the decision procedure a broader field of candidates. The article’s performance claims refer to a sample and to the versions and configurations tested. Its broader motivation is efficient processing at production scale, while the comparison itself is made on the stated document collection.

#### What the evaluation leaves open

The sample’s inclusion rule leaves out the most direct test of a useful behavior in unrestricted crawling. If a document gives no sound basis for a date, an extractor that leaves it blank has acted appropriately. If it chooses a date from a passing reference in that same document, it has produced a misleading answer. The reported experiment does not contain a distinct group of pages of that kind. The scores therefore leave open the rate of justified abstention and the rate of spurious dating when no identifiable document date exists.

The distinction matters especially for extensive search. A wider search can recover a valid cue on a datable page, which helps explain its appeal for the reported collection. On a page without a relevant date, it can still encounter date expressions as it searches through the content. The paper describes verification intended to address unsuitable candidates but gives no separate evaluation under that condition. The reported recall establishes reach on identifiable dates. Determining how that reach affects a less selective collection would require evidence about pages admitted under a different inclusion rule.

The package also supports two targets, original publication and most recent update. The benchmark table has no separate results for these targets. The article therefore establishes the features the package offers and reports its aggregate date extraction performance, while leaving the accuracy of update extraction and cases with both kinds of dates unresolved as separate questions. There is also no evaluation of whether a correct publication date can reliably be used as the time of a particular passage on a revised page. The relationship between the date and the language present in the version examined remains a matter of interpretation for the researcher.

The language and genre composition sets further limits on the reach of the scores. A sample selected from large German collections can show how the packages compare on those selected pages. A few inclusions from other languages widen the range of observed cases, while the paper gives no per-language sample sizes or scores. Likewise, the article names news outlets, blogs, smaller sites and harder pages without giving separate measurements for each group. The qualitative observations about improved coverage identify where the author saw gains. They cannot establish how large to expect those gains to be in another collection with a different distribution of page types.

Several details needed to assess robustness are also unreported in the article. It gives the test script and data location, but its presentation of the method does not fully specify candidate ranking or verification. It supplies no page-by-page attribution of success to header metadata, structural cues or the final search. It gives no uncertainty estimates or named statistical test alongside the aggregate comparison. The relative scores are clear for the tested collection. Sampling variation and the contribution of individual stages remain separate empirical questions.

Finally, there are different ways to interpret the scale of the timing result. The benchmark shows the reported cost of processing the selected collection under the comparison procedure. The design goal includes batch use on much larger collections. Performance over a large crawl would also depend on which inputs were supplied, how much work each page caused and whether downloading was part of the measured operation. The article includes download, parsing and extraction among the package’s capabilities, but supplies no separate timing breakdown for those operations. The reported times support a comparison of the tested runs, with the author’s qualification about differences in workload.

### What came after

#### Date extraction in a broader scraping task

A later citing work takes up a broader software task, discovering and extracting text from the web through a library and a command-line interface. The connection is easiest to see from the needs of the corpus described by Barbaresi. Extracted text can provide the passages a researcher wants to study, and a document date can supply the temporal context needed to interpret those passages. Htmldate addresses the latter field. The later work’s title identifies a broader text discovery and extraction workflow in which such a field would be relevant. The citation establishes a connection between the research projects, while the description of the later work leaves the details of any date extraction or integration unspecified. [Trafilatura: A Web Scraping Library and Command-Line Tool for Text Discovery and Extraction](https://md.research.elamur.ai/free/en/papers/barbaresi-2021-trafilatura-web-scraping-library-command/)

#### Publication dates in an evidence retrieval setting

Another citing work concerns image-text fact checking. Its title describes a dual-retriever approach using retrieval-augmented generation, in which material retrieved for a task is supplied to the system producing the response. The focus therefore moves from adding a date field to a collection of documents to finding evidence relevant to checking a claim involving images and text. Dating an evidence page and deciding whether that page bears on a claim are different decisions. When the timing of a publication matters to a claim, an original publication date and a later revision date would supply different context. That is a connection between the problems addressed by the works. The citation and title leave open whether the fact-checking system used htmldate to acquire dates, what it did with any dates it obtained, and whether dating affected its results. [AIC CTU@AVerImaTeC: dual-retriever RAG for image-text fact checking](https://md.research.elamur.ai/free/en/papers/ullrich-2026-aic-ctu-averimatec-dual-retriever/)

## Cite

Cite as Adrien Barbaresi. 2020. htmldate: A Python package to extract publication dates from web pages. The Journal of Open Source Software.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.21105/joss.02439](https://doi.org/10.21105/joss.02439)

```bibtex
@article{barbaresi2020htmldate,
  title = {{htmldate: A Python package to extract publication dates from web pages}},
  author = {Adrien Barbaresi},
  journal = {The Journal of Open Source Software},
  year = {2020},
  doi = {10.21105/joss.02439},
  url = {https://doi.org/10.21105/joss.02439}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
