LordPorker 7 Posted June 28, 2016 Report Share Posted June 28, 2016 So I'm creating a traffic bot right now. Finding it difficult getting the bot to click on a random link on the page. Has anyone managed to solve this? Note: I don't want to scrape links, and then go to the page; it's important to actually click the link. Quote Link to post Share on other sites
Macster (UBotter Labs) 112 Posted June 28, 2016 Report Share Posted June 28, 2016 So I'm creating a traffic bot right now. Finding it difficult getting the bot to click on a random link on the page. Has anyone managed to solve this? Note: I don't want to scrape links, and then go to the page; it's important to actually click the link. Not sure i understand why you don't want to scrape the links but there are 2 ways to do it: 1st. and the best method is to scrape the internal links into a list, clean the list to remove unwanted links to images and pages, and click randomly on one of them 2nd. is simpler but not as exact and can fail if too many links on the page: use wildcards to click on a random link using a random "$element offset". Quote Link to post Share on other sites
HelloInsomnia 1103 Posted June 28, 2016 Report Share Posted June 28, 2016 There are a couple of ways to do it but the easiest to explain is: Scrape all the links on the page (yes all not just internal) this is just getting you a number lets say there are 50 links then:Set a $rand from 0,49Scrape the link and see if it's internal using element offset with the random numberIf its internal then use element offset to click it Quote Link to post Share on other sites
deliter 203 Posted June 28, 2016 Report Share Posted June 28, 2016 heres what the lads above me said with the code define clickRandomLink { add list to list(%totalLinks,$scrape attribute(<tagname="a">,"outerhtml"),"Don\'t Delete","Local") click($element offset(<tagname="a">,$rand(0,$subtract($list total(%totalLinks),1))),"Left Click","No") } clickRandomLink() 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.