Jump to content
UBot Underground

Exbrowser Facebook Click Like And Comment Problems


Recommended Posts

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 each
navigate command, can similar be done within ExBrowser?

 

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

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)
    }
}
Link to post
Share on other sites
  • 3 months later...

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

Link to post
Share on other sites

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...