Jump to content
UBot Underground

how to handle redirects


Recommended Posts

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!!!

Link to post
Share on other sites

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

Link to post
Share on other sites

post duplicated itself...

 

bad bot!! http://ubotstudio.com/forum/public/style_emoticons/default/tongue.gif

Link to post
Share on other sites
  • 1 month later...

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

Link to post
Share on other sites

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 :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...