Looks like it's absolutely impossible with JavaScripts from back then
@vaporeon_ someone else in the forum I shared a screenshot from mentioned they had code specifically for locating elements relative to <a> tags but the link is broken and the wayback machine couldn't retrieve it
So what you're trying to do should be possible
@wallhackio May I have the link to the forum that you're reading?