htmldate | robust date extraction from web pages | Scraper library
kandi X-RAY | htmldate Summary
kandi X-RAY | htmldate Summary
Fast and robust date extraction from web pages, with Python or on the command-line
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Process command line arguments
- Compares a reference
- Find the date of the given HTML object
- Analyze HTML string
- Parse command line arguments
- Return the long description
- Get the package version
htmldate Key Features
htmldate Examples and Code Snippets
Community Discussions
Trending Discussions on htmldate
QUESTION
I want to extract date when news article was published on websites. For some websites I have exact html element where date/time is (div, p, time) but on some websites I do not have:
These are the links for some websites (german websites):
(3 Nov 2020) http://www.linden.ch/de/aktuelles/aktuellesinformationen/?action=showinfo&info_id=1074226
(10/22/2020) http://buchholterberg.ch/de/Gemeinde/Information/News/Newsmeldung?filterCategory=22&newsid=905
I have tried 3 different solutions with Python libs such as requests
, htmldate
and date_guesser
but I'm always getting None, or in case of htmldate
lib, I always get same date (2020.1.1)
ANSWER
Answered 2020-Dec-05 at 00:52I have never had much success with some of the date parsing libraries, so I usually go another route. I believe that the best method to extract the date strings from these sites in your question is with regular expressions.
website: linden.ch
QUESTION
I'm trying to develop a small script with Python in Anaconda to use htmldate, and when I try to run it I have some errors:
The code is this one:
...ANSWER
Answered 2020-Jul-20 at 17:16For some reason the python cannot find the lml
package.
To fix this, try uninstall and then install lxml:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install htmldate
You can use htmldate like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page