I have read this question and this question, and probably more questions, and want do to exactly what they do there but I just get empty results when I try.
I want to extract the profile link to all the followers here https://www.facebook.com/zuck/followers
A very crude Xpath that points to the name, which is a clickable link, of the follower is //*[@id="mount_0_0_MW"]/div/div[1]/div/div[3]/div/div/div/div[1]/div[1]/div/div/div[4]/div/div/div/div/div/div/div/div/div[3]/div/div[2]/div[1]/a
The a
-tag I point at typically looks something like this
<a class="x1i10hfl xjbqb8w x6umtig x1b1mbwd xaqea5y xav7gou x9f619 x1ypdohk xt0psk2 xe8uvvx xdj266r x11i5rnm xat24cr x1mh8g0r xexx8yu x4uap5 x18d9i69 xkhd6sd x16tdsg8 x1hl2dhg xggy1nq x1a2a7pz x1heor9g xt0b8zv"
href="https://www.facebook.com/profile.php?id=100072622654958" role="link" tabindex="0">
To extract the value of the href I, per the linked question, add /@href
to the end of the xpath above but when I evaluate this expression using $x in the browser console (in Safari) I get an empty result:
How do I rewrite my xpath so that I get an array with the values in the href-attribute when I evaluate it?