emilix85 0 Posted April 17, 2013 Report Share Posted April 17, 2013 Hi guys I completed my first bot now I have this need: I have to run the code directly in ubot on 3 different pages (I want to select this page manually): site/page1site/page2site/page3 i have try whit this code loop(3) { thread { in new browser { navigate("http://www.site.com/", "Wait") navigate("http://www.site.com/1", "Wait") navigate("http://www.site.com/3", "Wait") } } } Once loaded though these pages disappear...... Basically I want these pages remain activeso when run the bot, can work in multi-threading on all 3 pages Thanks Quote Link to post Share on other sites
VaultBoss 310 Posted April 17, 2013 Report Share Posted April 17, 2013 You are loading three pages, one after the other, in a single thread, in a single browser, so it is acting just as it should. If you want them to load separately, each link in a separate thread in a separate browser, you need to put them, one by one, in a separate thread (so you code 3 threads there, not only one, like you did now) If you want to write this even smarter, you store the URLs to navigate in a list, you build a define that navigates to the URL you feed to it as a parameter, then you LOOP n times through the list of URLs and code the instructions within the LOOP to open a new thread and a new browser (like you already coded) BUT you write the DEFINE calling only once, using the current list item as parameter... If you are new to UBS, the above may seem to be a bit complicated. So start by simply doing what I said for ONE single thread first: code the navigation in a DEFINE and call that define inside a loop with 1 iteration, using a parameter (variable) that contains the link, and not the link itself directly. Once you achieved that, you'll be prepared to do it as you want (multithreading) Cheers! 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.