HarryPotter 9 Posted May 7, 2012 Report Share Posted May 7, 2012 hello! don't know how to handle redirects. scenario:- there is a list of urls- the bot navigates to the urls- if page loads fine, then mark site as "okay" and navigate to next url the problem is, some of these urls are redirected... example... url 1 -> redirect #1 -> redirect #2 -> redirect #3 -> final url right now my code looks at redirect #1 and sees it loading fine, then marks the site as "okay"... but what i really want is to see if the final url is loading "okay" i have: navigate(#link, "Wait") wait(2) wait for browser event("Everything Loaded", "") but it seems i still can't guarantee it to wait for final url to load and check that one... any insights? Thanks!!! Quote Link to post Share on other sites
Legend 181 Posted May 7, 2012 Report Share Posted May 7, 2012 Every time you load a site you can store the URL into a variable, then after it loads store the (maybe) new url in a variable and then compare the two... if they are different you have a redirect and you can load the final url and check it... Or something like that... http://ubotstudio.com/forum/public/style_emoticons/default/blink.gif Quote Link to post Share on other sites
Legend 181 Posted May 7, 2012 Report Share Posted May 7, 2012 post duplicated itself... bad bot!! http://ubotstudio.com/forum/public/style_emoticons/default/tongue.gif Quote Link to post Share on other sites
malefic 48 Posted May 7, 2012 Report Share Posted May 7, 2012 If you don't mind using 3rd party sites, look at http://www.internetofficer.com/seo-tool/redirect-check/ May be worth asking for an enhancement to Ubot asking for something to read HTTP headers and detect the 301 part. Quote Link to post Share on other sites
VaultBoss 310 Posted June 21, 2012 Report Share Posted June 21, 2012 Every time you load a site you can store the URL into a variable, then after it loads store the (maybe) new url in a variable and then compare the two... if they are different you have a redirect and you can load the final url and check it... Quick Q .. how do I scrape the actual URL from the browser, after the redirect? In other words, I navigate to a url I give UBot, but that website has an internal redirect and instead of the url I gave it in the beginning, I end up on a different URL.How do I find what is that URL? Any idea? Thanks in advance, Steve Quote Link to post Share on other sites
VaultBoss 310 Posted June 21, 2012 Report Share Posted June 21, 2012 Quick Q .. how do I scrape the actual URL from the browser, after the redirect? In other words, I navigate to a url I give UBot, but that website has an internal redirect and instead of the url I gave it in the beginning, I end up on a different URL.How do I find what is that URL? Any idea? Thanks in advance, Steve Nevermind, I found the $url Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted June 21, 2012 Report Share Posted June 21, 2012 Its called $url. You can do something like this:if($not($contains($url, "yourdomainname.com"))) { then { navigate("http://www.yourdomainname.com/", "Wait") } else { } } 1 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.