Post to a fan page using Webbrowser

Asked

Viewed 126 times

1

I’m making an application to post on my fan pages, already log in, list the fan pages, it’s all right.

I’m just not getting to put the text in the facebook text box.

Look here:

<div data-block="true" data-offset-key="72l55-0-0" class="_209g _2vxa">
<span data-offset-key="72l55-0-0">
    <span data-text="true">Preciso colocar o texto aqui!!!</span>
</span>

HtmlElementCollection items = webBrowser1.Document.GetElementsByTagName("div");
foreach (HtmlElement item in items)
{
    if (item.GetAttribute("classname") == "_209g _2vxa")
    {
        item.InnerText = "oiii " + DateTime.Now;
        item.InvokeMember("click");
        //SendKeys.Send("{ENTER}");
    }
}
  • 2

    It’s a silly question, but wouldn’t it be better to use the Facebook API?

  • Randrade, problem that the API does not let me publish in Closed Groups, only Public Groups.

  • 2

    In this case, you are wanting to do something that is not allowed by Facebook. It is worth mentioning that this can cause a ban on the account in which you will be making the insertions.

  • 3

    Yes is allowed as long as you use the browser! Where this is prohibited?

  • 1

    If it is allowed, it has in the API, for example, the Facebook app for Android normally posts in closed groups, so it uses the Facebook API.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.