Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 Found a bug on the launcher.It doesnt fill up the form when the commands is outside the container. plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "") plugin command("ExBrowser.dll", "ExBrowser Navigate", "https://www.facebook.com/") plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"username\">", "value", "username") plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"passwd\">", "value", "password") You should always use a wait for element before you interact with an element. To give the site enough time to load the different elements.Specifically on facebook. It's a site that loads a lot of stuff dynamically in the background. And I also recommend to use xpath instead of ubot locators. Dan Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 23, 2015 Report Share Posted July 23, 2015 You should always use a wait for element before you interact with an element. To give the site enough time to load the different elements.Specifically on facebook. It's a site that loads a lot of stuff dynamically in the background. And I also recommend to use xpath instead of ubot locators. Dan Yes i already added longer waits and it still doesnt work.That code works when it's inside the exbrowser container. Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 23, 2015 Report Share Posted July 23, 2015 Suggestion: - Instead of a launcher command maybe just add an function that can put on the option of exbrowser container that will make the browser remain open so we can run the commands inside the container. If we want to close the browser we can simple call the "exbrowser cleanup" command. Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 Suggestion: - Instead of a launcher command maybe just add an function that can put on the option of exbrowser container that will make the browser remain open so we can run the commands inside the container. If we want to close the browser we can simple call the "exbrowser cleanup" command.That's not possible because of the Ubot API. Dan Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 23, 2015 Report Share Posted July 23, 2015 That's not possible because of the Ubot API. Dan Hmmn.. Thats a bummer.But no prob. I am still happy with the new feature. Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 23, 2015 Report Share Posted July 23, 2015 That's not possible because of the Ubot API. Dan Hmmn.. Thats a bummer.But no prob. I am still happy with the new feature. Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 Found a bug on the launcher.It doesnt fill up the form when the commands is outside the container. plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "") plugin command("ExBrowser.dll", "ExBrowser Navigate", "https://www.facebook.com/") plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"username\">", "value", "username") plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"passwd\">", "value", "password") So, after arriving at home after 3 days on the road.. I tested your exemple. 1. The code doesn't work in a container either. It would have surprised me, if it would work in container and not in launcher, because from a commands point of view there is not really any difference.Here's a screenshot:http://screencast.com/t/X9nn5fNnqS The problem is really, that the two fields are not:<name="username"><name="passwd"> They are:<name="email"><name="pass"> As soon as I change that in your code, everything works fine with and without container:plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "")plugin command("ExBrowser.dll", "ExBrowser Navigate", "https://www.facebook.com/")plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"email\">", "value", "username")plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"pass\">", "value", "password") Not sure if FB changed those field names or why it worked for you in the container, but from what I have in front of me here right now, the two fields have different names.And that seems to be the problem. Kindest regardsDan Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 My initial issue with the if statements i discovered that nested if statements with "exbrowser wait for element" is a bit temperamental,so i laid them out separate so the next "If" was not inside the preceding "else" and this seemed to resolve this issue,worth pointing out this is only happening with the "wait for element", all other nested If statements containing "comparison" or anything else works fine Now I'm confused. Exbrowser wait for element is a command, It doesn't return anything. So how do you use that in an if statement? If you use $ExBrowser Element Exist, that would be a different thing. Because that's a function and it will returnd True and False Dan Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 Hmmn.. Thats a bummer.But no prob. I am still happy with the new feature. It's really not needed Kreatus. The launcher and close command works perfectly fine. And it's much more reliable and controllable. With a container, every command within the container will be executed in one go. That's why it doesn't work with multithreading. But the launcher works. I posted the solution to your facebook issue above. And if I'm able to reproduce an issue with it, I will fix it asap. But we will not move back to the API container stuff. That really makes no sense. CheersDan Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 Hey Dan, Do you have a quick sample code on how to do this "Keep the Browser open for test&dev. Run single commands against Browser." ? NVM... Got it. You watched the V1.1.0.5 Tutorial videos right? I think someone explained how it works there. Just in case...https://botfactory.helpdocs.com/ CheersDan Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 The problem is really, that the two fields are not:<name="username"><name="passwd">These are generated from ubot. It has been explained in ubot blog long time ago i guess So it will only works using ubot browser Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 Now I'm confused. Exbrowser wait for element is a command, It doesn't return anything. So how do you use that in an if statement? If you use $ExBrowser Element Exist, that would be a different thing. Because that's a function and it will returnd True and False Danif{something}then{Exbrowser wait for elementif{$ExBrowser Element Exist}} something like this Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 These are generated from ubot. It has been explained in ubot blog long time ago i guess So it will only works using ubot browserGood hint James. Thanks a lot for that. Yeah, it might be, that Ubot is using some additional "placeholders" for some fields like name and password. But with exBrowser, you really have to look at the HTML code, and use the correct syntax. There is no translation or anything going on here. Dan Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 if{something}then{Exbrowser wait for elementif{$ExBrowser Element Exist}} something like this Could you please give me an example. What would you put into that if something condition? When you navigate to a site, or interact with a button. You normally would use the wait for element directly afterwards. To see if the element you expect actually appears. Your code is not wrong and should still work fine, I just can't imagine when I would use it in that way. Would be great if you could help me with that. Dan Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 I have replace the number from excel with ubot variable and if i check using this code : loop(1) {set(#Test1,123,"Global")if($is number(#Test1)) {then {alert("YES")}else {alert("NO")}}} it will show that the variable is number Do the same check with variable from scraped and it will show that it is not a number I don't have that excel / csv plugin to test this on my own. But you can try to isolate it. 1. Read the data from the excel file into a variable (#data1) And then compare it to the number directly.if($comparison(#data1,"= Equals",123)) { then { alert("Match") } else { alert("No Match") }} Then you can see, if the problem is already with the stuff you have in the first variable. The one thing I could think of here is, that your variable contains a LF which is not visible.So depending on how the excel / csv plugin works, it could return a LF or CLF at the end of the cell you read. I good test would be to save the variable to a file:save to file(#data1,"d:\\test.txt") And then open it with Notepadd++ to see if it contains additional characters and stuff. Another thing you could try is to filter your string with a regular expression. Just to ensure that there is no additional stuff:set(#data2,$find regular expression(#data1,"[0-9]+"),"Global") I hope that helpsDan Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted July 23, 2015 Report Share Posted July 23, 2015 So, after arriving at home after 3 days on the road.. I tested your exemple. 1. The code doesn't work in a container either. It would have surprised me, if it would work in container and not in launcher, because from a commands point of view there is not really any difference.Here's a screenshot:http://screencast.com/t/X9nn5fNnqS The problem is really, that the two fields are not:<name="username"><name="passwd"> They are:<name="email"><name="pass"> As soon as I change that in your code, everything works fine with and without container:plugin command("ExBrowser.dll", "ExBrowser Launcher", "Chrome", "", "")plugin command("ExBrowser.dll", "ExBrowser Navigate", "https://www.facebook.com/")plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"email\">", "value", "username")plugin command("ExBrowser.dll", "ExBrowser Change Attribute", "<name=\"pass\">", "value", "password") Not sure if FB changed those field names or why it worked for you in the container, but from what I have in front of me here right now, the two fields have different names.And that seems to be the problem. Kindest regardsDan I swear the code worked yesterday..Anyway, your code works! It looks like i need to play more with the elements. Quote Link to post Share on other sites
Bot-Factory 602 Posted July 23, 2015 Report Share Posted July 23, 2015 I swear the code worked yesterday..Anyway, your code works! It looks like i need to play more with the elements. Sometimes dynamic websites change their element names frequently to prevent bots. Or show different names depending on your location and the browser you use. Dan Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted July 24, 2015 Report Share Posted July 24, 2015 Now I'm confused. Exbrowser wait for element is a command, It doesn't return anything. So how do you use that in an if statement? If you use $ExBrowser Element Exist, that would be a different thing. Because that's a function and it will returnd True and False Dan My mistake when writing, your right $ExBrowser Element Exist is exactly what i mean inside If statements, The "Wait for element" behaves in a similar manner, in that it sometimes doesnt wait sorry about thatIll re-check my sentence before i post next time Quote Link to post Share on other sites
Bot-Factory 602 Posted July 24, 2015 Report Share Posted July 24, 2015 My mistake when writing, your right $ExBrowser Element Exist is exactly what i mean inside If statements, The "Wait for element" behaves in a similar manner, in that it sometimes doesnt wait sorry about thatIll re-check my sentence before i post next time As soon as the related HTML code appears on the page, the command will continue. One problem people have with this sometimes is, that they don't check the html code to see if the same element is used multiple times.So it could be, that the element you are waiting for is not there yet, but another element that matches your locator is already loaded. If saw this multiple times already. So you have to ensure that you'r element locator expression is unique. And it only has 1 match for the element you are looking for. Could you please double check that to see if this might be the case here? Dan Quote Link to post Share on other sites
mr.kim8692 2 Posted July 25, 2015 Report Share Posted July 25, 2015 Hey Dan I just purchased, please check your mail, thanks you Quote Link to post Share on other sites
rocket976 62 Posted July 25, 2015 Report Share Posted July 25, 2015 Probably be a few hours before Dan wakes up 5:20 AMSaturday, July 25, 2015 (GMT+2) Time in Germany Quote Link to post Share on other sites
Bot-Factory 602 Posted July 25, 2015 Report Share Posted July 25, 2015 Hey Dan I just purchased, please check your mail, thanks youHello. All license requests in the ticket system have been answered. There was no Mr. Kim8692 in my inbox, but you might have used a different name there. CheersDan Quote Link to post Share on other sites
cүвεя_נυηкιε 68 Posted July 25, 2015 Report Share Posted July 25, 2015 As soon as the related HTML code appears on the page, the command will continue. One problem people have with this sometimes is, that they don't check the html code to see if the same element is used multiple times.So it could be, that the element you are waiting for is not there yet, but another element that matches your locator is already loaded. If saw this multiple times already. So you have to ensure that you'r element locator expression is unique. And it only has 1 match for the element you are looking for. Could you please double check that to see if this might be the case here? Dan Hi, Would this also happen if an element is hidden on a page ? Asking this because one in particular is set to wait for a counter to reach "0" but it literally just skips over the node, but if i put into an IF statement to check it works every time also, strait after that particular wait for element is another set to wait for Text "You have just ..." to appear which is strait after the counter reaches 0and it waits for a while (like 3-7 seconds) but will move before it appears,again tested with If statement and also works every time Its not really a bother as i just placed a 5 second wait after Quote Link to post Share on other sites
Bot-Factory 602 Posted July 25, 2015 Report Share Posted July 25, 2015 Hi, Would this also happen if an element is hidden on a page ? Asking this because one in particular is set to wait for a counter to reach "0" but it literally just skips over the node, but if i put into an IF statement to check it works every time also, strait after that particular wait for element is another set to wait for Text "You have just ..." to appear which is strait after the counter reaches 0and it waits for a while (like 3-7 seconds) but will move before it appears,again tested with If statement and also works every time Its not really a bother as i just placed a 5 second wait after I need an example to give you an answer here.You can send it to me via a support ticket and I will take a look at the site and your code. But please prepare it in a way so that I can directly load and run your example bot and see the issue. Kindest regardsDan Quote Link to post Share on other sites
Frank 177 Posted July 25, 2015 Report Share Posted July 25, 2015 Guys do you think it's possible to implement this with independent versions of chrome and Firefox like this: http://portableapps.com/apps/internet/firefox_portable? This would let us package a known version of a browser with our complied bots. Frank 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.