A crawler I am writing needs to be able to extract the time information of posts on the page, but I don’t want to apply templates. How to extract directly is similar to
11 minutes ago、
Half an hour ago.、
An hour ago、
Yesterday at 15:04A kind of friendly time text displayed in natural language? As long as I can extract the character string, I can finish the time analysis after extraction by myself.
You should use schemes such as XPath or CSS selectors. Specific content on a web page will have specific characteristics.