Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
Get Facebook post URL only in javascript

I want to get facebook recent post URL on my wall using pure javascript (with no use of the API).
regularly I would do that by clicking on the time/date the post was posted on and it will get load a new page including only that post.
In Javascript, the a element that will hold the last post URL would be:

let a = document.getElementsByClassName("oajrlxb2 g5ia77u1 qu0x051f esr5mh6w e9989ue4 r7d6kgcz rq0escxv nhd2j8a9 nc684nl6 p7hjln8o kvgmc6g5 cxmmr5t8 oygrvhab hcukyx3x jb3vyjys rz4wbd8a qt6c0cv9 a8nywdso i1ao9s8h esuyzwwr f1sip0of lzcic4wl gmql0nx0 gpro0wi8 b1v8xokw")[0];

The problem is that a.href's value (at default) will be https://www.facebook.com/#, and only when I hover over the time/date then the a.href's value will be changed to the actual recent post URL.
I tried to simulate that mouse hover by a.dispatchEvent(new Event('mouseover')) with no success.
I also collected all the eventListeners of all relevant elements of the last post by running over all the a's parents/children and getEventListeners() function, fired 'em all up with no success also.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!