LordPorker 7 Posted May 2, 2016 Report Share Posted May 2, 2016 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 Quote Link to post Share on other sites
deliter 203 Posted May 3, 2016 Report Share Posted May 3, 2016 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 Quote Link to post Share on other sites
Frank 177 Posted May 9, 2016 Report Share Posted May 9, 2016 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 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.