Jump to content
UBot Underground

Advice On Loop While & Else


Recommended Posts

So I'm creating a bot that scrapes a proxy site, but I think the logic is whack so looking for some advice.

 

I've put almost all of the commands in a loop while, and if the next button is live then click to the next page. When it reaches the final page, it stops ok but it seems to fail on the else section, namely save to file & the alert popup. Can anyone tell me why?

 

 

Bot is attached.

 

###Update###

 

Ok, so I deleted the else section, and put the save file & alert outside the loop while. It seems to work ok.

Proxy Scraper.ubot

Link to post
Share on other sites

Ive only taken a glance so I maybe wrong

 

Your loop while has the same condition as the following if statement

 

so when it clicks number 15,on then loop while it will evaluate as false,then exit the entire loop while,so your else statement will be ignored

 

solution: just put the else code after the loop while container

Link to post
Share on other sites

Ok, yes your logic is a bit wacked. You are calling an if statement based upon the same condition of the loop. If it passes on one, it will pass on the other. You technically should never call the else in the if statement.

 

I must say I like how you used the offset statement and a variable to call each ip and port, one after another. The only time you could run into errors is if 20 addresses are not present. It will cause your scrapes to error out or return nothing at the least.

 

Personally a better way to scrape the entries is to use the 'scrape table' command will let you pull the whole table in one swoop. Add it to another table and keep scraping it, page after page.

 

Then when the loop fails, then save to file and pop up your alert.

 

Frank

  • Like 1
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...