Vladislav 2 Posted August 17, 2015 Report Share Posted August 17, 2015 Hi guys, i am trying to make a bot which will connect to my website , but i want to block certain pages to not be accessible when browsing the website via the ubot interface.For example i want cafegourme.com/4-paketirano-kafe to can be opened but if anyone click on Contact us link (cafegourme.com/content/6-kontakti) not to be taken to the actual page, preferably to stay on the same page and receive error "action not permitted" ;I was thinking a lot about this, searched in here and in Google but nothing found..I would appreciate any suggestions. Quote Link to post Share on other sites
deliter 203 Posted August 17, 2015 Report Share Posted August 17, 2015 I dont think this would be a very good way but it is a way loop while($comparison(1,"=",1)) { if($comparison($url,"= Equals","http://www.ubotstudio.com/forum/index.php?/topic/18203-how-to-block-certain-urls-of-being-opened/")) { then { load html("<center><b><h1 style='color:red;'>this action is not permitted</h1></b></center>") navigate("http://www.ubotstudio.com/forum","Wait") } else { wait(0.2) } }} Quote Link to post Share on other sites
deliter 203 Posted August 17, 2015 Report Share Posted August 17, 2015 heres a lot better code for this just have it execute this once the page loads,and change the href to whatever run javascript("var myHref = document.getElementById(\"contact-link\").getElementsByTagName(\"a\")myHref[0].href=\'{$url}\'") but this has the problem that if the user changes page and comes back to this,if this script doesnt execute the link will not be disables,hope its a help though 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted August 17, 2015 Report Share Posted August 17, 2015 use "change attribute" to change url or even remove the link and text completely or use javascript to do thisremove element but here is how to change the url to bing navigate("http://www.ubotstudio.com/forum/index.php?/topic/18203-how-to-block-certain-urls-of-being-opened/#entry113023","Wait") wait for element(<title="Homepage">,"","Appear") change attribute(<title="Homepage">,"innertext","Go to Bing") change attribute(<href="http://www.ubotstudio.com/forum">,"href","http://bing.com") alert($scrape attribute(<title="Homepage">,"href")) wait(.5) click(<title="Homepage">,"Left Click","No") where the url for bing is you can just leave blank same as the link text and they wont see it. play around, enjoy, and have fun CD Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted August 17, 2015 Report Share Posted August 17, 2015 heres a lot better code for this just have it execute this once the page loads,and change the href to whatever run javascript("var myHref = document.getElementById(\"contact-link\").getElementsByTagName(\"a\")myHref[0].href=\'{$url}\'")lol this was not there when I arived. but is exactly what I meant with JS Quote Link to post Share on other sites
deliter 203 Posted August 17, 2015 Report Share Posted August 17, 2015 lol this was not there when I arived. but is exactly what I meant with JS Ha Ha Your code was not their when I posted that neither,because I always forget how useful the change attribute command is,no JS needed change attribute(<href="http://cafegourme.com/content/6-kontakti">,"href","http://cafegourme.com/4-paketirano-kafe") Quote Link to post Share on other sites
Vladislav 2 Posted August 17, 2015 Author Report Share Posted August 17, 2015 Thanks a lot for the help! I will play around with the codes your provided and will resolve my issue.Always great to see that here are people who help with coding issues. Big respect to you! Quote Link to post Share on other sites
sazuka 0 Posted February 9, 2016 Report Share Posted February 9, 2016 this is awesome Code Docta (Nick) But after clicking on something else on a website it shows the link again. Is there a way to run the code everytime a person clicks on any link? use "change attribute" to change url or even remove the link and text completely or use javascript to do thisremove element but here is how to change the url to bing navigate("http://www.ubotstudio.com/forum/index.php?/topic/18203-how-to-block-certain-urls-of-being-opened/#entry113023","Wait") wait for element(<title="Homepage">,"","Appear") change attribute(<title="Homepage">,"innertext","Go to Bing") change attribute(<href="http://www.ubotstudio.com/forum">,"href","http://bing.com") alert($scrape attribute(<title="Homepage">,"href")) wait(.5) click(<title="Homepage">,"Left Click","No") where the url for bing is you can just leave blank same as the link text and they wont see it. play around, enjoy, and have fun CD Quote Link to post Share on other sites
jange8f18 0 Posted July 27, 2019 Report Share Posted July 27, 2019 hi guys, I need this to run every time someone clicks a link or page is refreshed 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.