How to get exact date from Linkedin's post while inspecting site with selenium?
12,061
Solution 1
I decoded the post id to find the timestamp. Method and (js) code here: https://github.com/Ollie-Boyd/Linkedin-post-timestamp-extractor.
From the 19 digit Linkedin post ID (after some trial and error) I found we can convert the post ID to binary, then convert the first 41 binary bits to a decimal to give the UNIX timestamp in milliseconds.
Solution 2
Not really, if you check the html you will see that you have a basic string:
The only workaround for your problem is to create a method:
- Extract the current date (formatted as desired)
- Extract from LI how much time passed
- Create your logic based on extracted data (for hours, days, weeks, months, years) and do the math with your extracted current date. This one shouldn't be too difficult since any programming language has libraries to help you.
Author by
Jacek Antek
Updated on June 04, 2022Comments
-
Jacek Antek almost 2 years
i am using selenium chrome driver to scratch Linkedin's profile. I am doing analysis for my post. It is the way to get exact date from Linkedin's post in format "dd.mm.yyyy" instead of "1 month ago", "2 weeks ago"?
Please help, Jacek
-
Amruta over 3 yearsstackoverflow.com/questions/127803/… this might help you
-
rahul rai over 3 yearsAs There is no information in the HTML of post regarding post date. I afraid you can get exact date. However based on information present there like 1 mo. , 2 Week you can do calculations and get approx date by subtracting from current system date.
-
Jacek Antek over 3 yearsThank you Guys! The first link i do not know if it is on topic
-