Glassy 0 Posted September 25, 2013 Report Share Posted September 25, 2013 Does anyone know how to click on a Facebook link that goes to another site? I can't seem to find a way to click on a link that points to another site. There is probably some regex or other method to do this but I haven't been able to figure it out yet. I don't want to navigate to the external site from the Facebook page as I am trying to simulate a click and navigating doesn't register as a click. Cheers. Quote Link to post Share on other sites
UBotDev 276 Posted September 25, 2013 Report Share Posted September 25, 2013 You should first scrape all "href"s to a list, and remove ones that don't contain "facebook.com". Then you just pick the url from the list and you click it, like this: click($element offset($element from text("<url=\"{$list item(%list, 0)}\">"), 0), "Left Click", "No") This might get complicated if JavaScript is used to hide URLs/external links, but it should be still doable. Quote Link to post Share on other sites
Glassy 0 Posted September 25, 2013 Author Report Share Posted September 25, 2013 Hi, Thanks for your response. I am currently just trying to get the click to work with that code you provided by adding a URL to a list. I can't seem to get it working though. If I add a URL to the list that is on the FB page, can it be in the raw URL format without any href or html and will it still click it? Cheers. Quote Link to post Share on other sites
UBotDev 276 Posted September 25, 2013 Report Share Posted September 25, 2013 I've updated the code above so it's ready to be used. I'm not sure what you mean by "URL format without any href", but you can only use the URL, the code will click the first URL match on the page. Quote Link to post Share on other sites
Glassy 0 Posted September 26, 2013 Author Report Share Posted September 26, 2013 Thanks for that. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.