phphtmlweb-scraping

Where does the timestamp of a Facebook's post/article is fetched from?


I am unable to find the source from where the timestamp in Facebook's article is fetched. For instance, refer below article. https://www.facebook.com/ExpressTechie/posts/727234409422752/


Timestamp of post


There are multiple script tags in its page source but none has pertaining about same. If found, what time zone would it fetch the timestamp in.

Thank you all in advance.


Solution

  • I was able to retrieve the facebook post's creation time. It is inside a script tag containing JSON data whose xpath is as below.

    //script[contains(text(), "ScheduledServerJSWithCSS") and contains(text(), "image")]/text()

    Search for a key "creation_time" whose value would be in UNIX time format. Convert it to UTC time and you are good to go.