Fast and robust date extraction from web pages, with Python or on the command-line
157
stars
631
commits
Python
primary language
Jul 31, 2026
updated
Find original and updated publication dates of any web page. It is often not possible to do it using just the URL or the server response.
On the command-line or with Python, all the steps needed from web page download to HTML parsing, scraping, and text analysis are included.
The package is used in production on millions of documents and integrated into thousands of projects.
>>> from htmldate import find_date
>>> find_date('http://blog.python.org/2016/12/python-360-is-now-available.html')
'2016-12-23'
$ htmldate -u http://blog.python.org/2016/12/python-360-is-now-available.html
'2016-12-23'
Htmldate operates by sifting through HTML markup and if necessary text elements. It features the following heuristics:
link and meta elements) including Open Graph
protocol attributes.abbr or time elements and a series of attributes (e.g.
postmetadata).fast mode the HTML page is cleaned and precise patterns are
targeted.extensive mode all potential dates are collected and a
disambiguation algorithm determines the best one.Finally, the output is validated and converted to the chosen format.
1000 web pages containing identifiable dates (as of 2026-06-01 on Python 3.13)
| Python Package | Precision | Recall | Accuracy | F-Score | Time |
|---|---|---|---|---|---|
| articleDateExtractor 0.20 | 0.846 | 0.745 | 0.656 | 0.792 | 3x |
| date_guesser 2.1.4 | 0.832 | 0.611 | 0.544 | 0.705 | 11x |
| goose3 3.1.21 | 0.930 | 0.568 | 0.545 | 0.706 | 14x |
| htmldate[all] 1.10.0 (fast) | 0.924 | 0.927 | 0.861 | 0.925 | 1x |
| htmldate[all] 1.10.0 (extensive) | 0.908 | 0.993 | 0.903 | 0.949 | 1.8x |
| newspaper4k 0.9.5 | 0.912 | 0.728 | 0.680 | 0.810 | 2.5x |
| news-please 1.6.16 | 0.845 | 0.777 | 0.680 | 0.810 | 29x |
For the complete results and explanations see evaluation page.
Htmldate is tested on Linux, macOS and Windows systems, it is compatible
with Python 3.10 upwards. It can notably be installed with pip (pip3
where applicable) from the PyPI package repository:
pip install htmldatepip install htmldate[speed]The last version to support Python 3.6 and 3.7 is htmldate==1.8.1; for
Python 3.8 and 3.9 use the 1.9.x series.
For more details on installation, Python & CLI usage, please refer to the documentation: htmldate.readthedocs.io
This package is distributed under the Apache 2.0 license.
Versions prior to v1.8.0 are under GPLv3+ license.
Initially launched to create text databases for research purposes at the Berlin-Brandenburg Academy of Sciences (DWDS and ZDL units), this project continues to be maintained but its future development depends on community support.
If you value this software or depend on it for your product, consider sponsoring it and contributing to its codebase. Your support will help maintain and enhance this package. Visit the Contributing page for more information.
Reach out via the software repository or the contact page for inquiries, collaborations, or feedback.
@article{barbaresi-2020-htmldate,
title = {{htmldate: A Python package to extract publication dates from web pages}},
author = "Barbaresi, Adrien",
journal = "Journal of Open Source Software",
volume = 5,
number = 51,
pages = 2439,
url = {https://doi.org/10.21105/joss.02439},
publisher = {The Open Journal},
year = 2020,
}
Kudos to the following software libraries:
Python
100.0%
Fast and robust date extraction from web pages, with Python or on the command-line
157
stars
631
commits
Python
primary language
Jul 31, 2026
updated
Find original and updated publication dates of any web page. It is often not possible to do it using just the URL or the server response.
On the command-line or with Python, all the steps needed from web page download to HTML parsing, scraping, and text analysis are included.
The package is used in production on millions of documents and integrated into thousands of projects.
>>> from htmldate import find_date
>>> find_date('http://blog.python.org/2016/12/python-360-is-now-available.html')
'2016-12-23'
$ htmldate -u http://blog.python.org/2016/12/python-360-is-now-available.html
'2016-12-23'
Htmldate operates by sifting through HTML markup and if necessary text elements. It features the following heuristics:
link and meta elements) including Open Graph
protocol attributes.abbr or time elements and a series of attributes (e.g.
postmetadata).fast mode the HTML page is cleaned and precise patterns are
targeted.extensive mode all potential dates are collected and a
disambiguation algorithm determines the best one.Finally, the output is validated and converted to the chosen format.
1000 web pages containing identifiable dates (as of 2026-06-01 on Python 3.13)
| Python Package | Precision | Recall | Accuracy | F-Score | Time |
|---|---|---|---|---|---|
| articleDateExtractor 0.20 | 0.846 | 0.745 | 0.656 | 0.792 | 3x |
| date_guesser 2.1.4 | 0.832 | 0.611 | 0.544 | 0.705 | 11x |
| goose3 3.1.21 | 0.930 | 0.568 | 0.545 | 0.706 | 14x |
| htmldate[all] 1.10.0 (fast) | 0.924 | 0.927 | 0.861 | 0.925 | 1x |
| htmldate[all] 1.10.0 (extensive) | 0.908 | 0.993 | 0.903 | 0.949 | 1.8x |
| newspaper4k 0.9.5 | 0.912 | 0.728 | 0.680 | 0.810 | 2.5x |
| news-please 1.6.16 | 0.845 | 0.777 | 0.680 | 0.810 | 29x |
For the complete results and explanations see evaluation page.
Htmldate is tested on Linux, macOS and Windows systems, it is compatible
with Python 3.10 upwards. It can notably be installed with pip (pip3
where applicable) from the PyPI package repository:
pip install htmldatepip install htmldate[speed]The last version to support Python 3.6 and 3.7 is htmldate==1.8.1; for
Python 3.8 and 3.9 use the 1.9.x series.
For more details on installation, Python & CLI usage, please refer to the documentation: htmldate.readthedocs.io
This package is distributed under the Apache 2.0 license.
Versions prior to v1.8.0 are under GPLv3+ license.
Initially launched to create text databases for research purposes at the Berlin-Brandenburg Academy of Sciences (DWDS and ZDL units), this project continues to be maintained but its future development depends on community support.
If you value this software or depend on it for your product, consider sponsoring it and contributing to its codebase. Your support will help maintain and enhance this package. Visit the Contributing page for more information.
Reach out via the software repository or the contact page for inquiries, collaborations, or feedback.
@article{barbaresi-2020-htmldate,
title = {{htmldate: A Python package to extract publication dates from web pages}},
author = "Barbaresi, Adrien",
journal = "Journal of Open Source Software",
volume = 5,
number = 51,
pages = 2439,
url = {https://doi.org/10.21105/joss.02439},
publisher = {The Open Journal},
year = 2020,
}
Kudos to the following software libraries:
Python
100.0%