ILoveUBot 10 Posted March 31, 2016 Report Share Posted March 31, 2016 Hi,I'm using the Exbrowser plugin (latest version Update V1.1.7.7) on UBot 5 v17.I'm botting Facebook in Firefox. Like Page() Like Post() Share with Group() FB Comment()I've managed to automate 'Like Page' and 'Share with Group' but 'Like Post' gets skipped completely (works when I manually run the nodes) and 'FB Comment' throws up an error: Object reference not set to an instance of an object. - Could it be that I've not chosen the right attribute for xpath? (this code also works sometimes when I manually run the nodes)Here's my code that only works when manually running the nodes: define Like Post { wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://a[@class=\"UFILikeLink _4x9- _4x9_ _48-k\"]") wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://a[@data-testid=\"fb-ufi-likelink\"]") wait(1) loop(1) { plugin command("ExBrowser.dll", "ExBrowser Click", "x://div[@class=\"_4sm1\"]") wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://div[contains(text(),\"Like\")]") } wait(3) } define FB Comment { plugin command("ExBrowser.dll", "ExBrowser Click", "x://a[@title=\"Leave a comment\"]") wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://div[@title=\"Write a comment...\"]") wait(1) loop(1) { wait(0.75) plugin command("ExBrowser.dll", "ExBrowser Click", "x://div[@class=\"_1mf _1mj\"]") wait(0.75) plugin command("ExBrowser.dll", "ExBrowser Type Text", "x://div[@title=\"Write a comment...\"]", "{#myComment}") wait(1) loop(2) { plugin command("ExBrowser.dll", "ExBrowser Send Special Key", "x://div[@role=\"combobox\"]", "Enter") } wait(3) } }Here's my code that is working: define Like Page { if($plugin function("ExBrowser.dll", "$ExBrowser Element Exist", "x://a[contains(@class,\"photoViewerFollowLink\")]")) { then { plugin command("ExBrowser.dll", "ExBrowser Click", "x://a[contains(@class,\"photoViewerFollowLink\")]") } } } define Share with Group { wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://a[contains(@href,\"/ajax/sharer/?\")]") wait(7) plugin command("ExBrowser.dll", "ExBrowser Click", "x://span[contains(text(),\"Share on your own Timeline\")]") wait(3) plugin command("ExBrowser.dll", "ExBrowser Click", "x://span[contains(text(),\"Share in a group\")]") wait(1) loop(1) { plugin command("ExBrowser.dll", "ExBrowser Click", "x://input[@id=\"audience_group\"]") plugin command("ExBrowser.dll", "ExBrowser Type Text", "x://input[@id=\"audience_group\"]", "{#myGroup}") wait(1) plugin command("ExBrowser.dll", "ExBrowser Send Special Key", "x://input[@id=\"audience_group\"]", "Down") wait(1) plugin command("ExBrowser.dll", "ExBrowser Send Special Key", "x://input[@id=\"audience_group\"]", "Tab") wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://button[@class=\"_2g61 _4jy0 _4jy3 _4jy1 _51sy selected _42ft\"]") wait($rand(3,7)) } }Also, if I want to loop through a list of approx 50 Facebook posts to navigate to and leave a comment, is there something I should be doing to refresh the browser without having to re-launch and login each time? When I did it in UBot without the ExBrowser plugin, I always started with 'os free memory' and 'set user agent' to re-initialize before eachnavigate command, can similar be done within ExBrowser? Quote Link to post Share on other sites
oricoun 4 Posted April 1, 2016 Report Share Posted April 1, 2016 Hi, Iloveubot, I love you ubot TOO, btw. FB can be tricky, I didnt run your code, but briefly, I would suggest to you to scrape particular "class" and then click it, or manipulate it.I think this class keeps changing. Quote Link to post Share on other sites
ILoveUBot 10 Posted April 2, 2016 Author Report Share Posted April 2, 2016 Thanks Oricoun, I zoned further into the classes and began to make progress... I've now got 'Like Post' working: define Like Post { loop(1) { plugin command("ExBrowser.dll", "ExBrowser Move Mouse", "x://a[@class=\"UFILikeLink _4x9- _4x9_ _48-k\"]") wait(1) plugin command("ExBrowser.dll", "ExBrowser Click", "x://div[@class=\"_4sm1\"]") } wait(3) } I've revised the 'FB Comment' code and now it sometimes works but still occasionally throws up the error: Object reference not set to an instance of an object. define FB Comment { loop(1) { plugin command("ExBrowser.dll", "ExBrowser Click", "x://div[@class=\"_1mf _1mj\"]") wait(0.75) plugin command("ExBrowser.dll", "ExBrowser Type Text", "x://div[@title=\"Write a comment...\"]", $spin("\{MyText1|MyText2|MyText3|MyText4\}")) wait(0.75) plugin command("ExBrowser.dll", "ExBrowser Send Special Key", "x://div[@role=\"combobox\"]", "Enter") wait(3) } } Quote Link to post Share on other sites
cob007 19 Posted July 7, 2016 Report Share Posted July 7, 2016 I am having trouble finding the xpath for status update, Do you guys now what will be xpath for writing a status update? Quote Link to post Share on other sites
cob007 19 Posted July 7, 2016 Report Share Posted July 7, 2016 Okay i was able to get to post update woth chrome but then ive to run it on incognito mode or else the chrome facebook status notification appears. but if i try to do same thing with phantom js it doesnt work Quote Link to post Share on other sites
Bot-Factory 602 Posted July 8, 2016 Report Share Posted July 8, 2016 Okay i was able to get to post update woth chrome but then ive to run it on incognito mode or else the chrome facebook status notification appears. but if i try to do same thing with phantom js it doesnt work For Chrome you can also try:https://botfactory.helpdocs.com/exbrowser-plugin/disable-alert-notification-popups Dan 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.