-Illuminati- 1 Posted June 26, 2015 Report Share Posted June 26, 2015 (edited) So my end goal is to make it visit http://whatismyip.com/ and if it can't get to the webpage, the proxy needs to be changed with a loop while that looks for a specific text given by the browser that $exists. When I set it to that text, and that text is on the web page, it skips the rest of the loop and goes on. I don't think my words are making very much sense, so here is a picture to describe what I mean: http://puu.sh/iDbke/546f1bd4e2.jpg I intentionally placed a fake proxy for the first line so I can combat the issue. Post #7 contains my solution. Edited June 27, 2015 by Ingram Assets Quote Link to post Share on other sites
itexspert 47 Posted June 26, 2015 Report Share Posted June 26, 2015 May i suggest you just let us see the code maybe we can help! I cant help you like this but i suspect your issue is quite simple you probably placed the wrong if statement If Text Exists Than Start $Loop WhileElse Continue with the script So Problem is Somewhere in your IF Statement! Problem Could be with Timing of it all (I Noticed you use Wait Command instead of "Wait for element") So if you could post your code we could help you! Quote Link to post Share on other sites
Fer 26 Posted June 26, 2015 Report Share Posted June 26, 2015 Use "Search page" instead and see if that works! Quote Link to post Share on other sites
Brutal 164 Posted June 27, 2015 Report Share Posted June 27, 2015 In your image you show that the loop while is based on something existing - So, as soon as it does not find what it is looking for, the loop while ends. So if I understand your code correctly - the moment your script hits a good proxy, the loop-while process ends. So as long as all of that code is nested inside of a loop, it should be fine. You might want to look around the forum a bit - there are people who have posted complete source code for proxy checkers. Quote Link to post Share on other sites
-Illuminati- 1 Posted June 27, 2015 Author Report Share Posted June 27, 2015 May i suggest you just let us see the code maybe we can help! I cant help you like this but i suspect your issue is quite simple you probably placed the wrong if statement If Text Exists Than Start $Loop WhileElse Continue with the script So Problem is Somewhere in your IF Statement! Problem Could be with Timing of it all (I Noticed you use Wait Command instead of "Wait for element") So if you could post your code we could help you! if($exists(<innertext="Could not create a connection to the proxy server.">)) { then { loop while($exists(<innertext="Could not create a connection to the proxy server.">)) { alert("Changing Proxy") increment(#proxyposition) change proxy($list item(%proxy,#proxyposition)) navigate("http://whatismyip.com/","Wait") wait(5) } } else { } } That is my code for the entire if statement containing the loop. Quote Link to post Share on other sites
-Illuminati- 1 Posted June 27, 2015 Author Report Share Posted June 27, 2015 In your image you show that the loop while is based on something existing - So, as soon as it does not find what it is looking for, the loop while ends. So if I understand your code correctly - the moment your script hits a good proxy, the loop-while process ends. So as long as all of that code is nested inside of a loop, it should be fine. You might want to look around the forum a bit - there are people who have posted complete source code for proxy checkers. Yeah, I have searched a bit, my problem is getting the code to loop again when the proxy is bad. I compared mine to others, and its very similar, so I don't see what I am doing incorrectly. Quote Link to post Share on other sites
-Illuminati- 1 Posted June 27, 2015 Author Report Share Posted June 27, 2015 I guess I have got it to work with the following code: loop while($exists(<innertext="Could not create a connection to the proxy server.">)) { increment(#proxyposition) change proxy($list item(%proxy,#proxyposition)) navigate("http://whatismyip.com/","Wait") wait for browser event("Everything Loaded","") } Quote Link to post Share on other sites
Brutal 164 Posted June 28, 2015 Report Share Posted June 28, 2015 Ingram - that code means that when it hits a good proxy it will stop running the loop-while loop. As long as you have the loop-while nested inside of a loop then you'll be good to go. 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.