Webbrowser can’t play my text in the text box

Asked

Viewed 75 times

0

I have a system running on a client and now he asked me for a feature that I’m a few days cracking my head and I can’t do.

He needs the application to post in his facebook groups at a certain time some publications of the academy, I managed to do this but using the url of the mobile version of facebook.

Using the standard version I can not find the element on the page to make the publication, as in the mobile version I can not get the image that is generated on the wall did not meet the customer.

For publication in the url M.FACEBOOK.COM I am using the following code.

HtmlElementCollection elements = browser.Document.GetElementsByTagName("input");
foreach (HtmlElement currentElement in elements)
{

    if ((currentElement.GetAttribute("type") == "submit") && (currentElement.Name == "view_post"))
    {
        string postagem = txtPublicacao1.Text;
        HtmlElement elea = browser.Document.GetElementById("u_0_0");
        if (elea != null) elea.SetAttribute("value", TextoPublicacao);
        {

            await Task.Delay(1000);
            currentElement.InvokeMember("click");
            txtStatus.Invoke((MethodInvoker)(() => txtStatus.Text += "*HORA Postado: " + DateTime.Now.ToString("G") + " ID -> " + qtdpostGrupo.ToString() + " LINK ->  " + e.Url.ToString() + "\r\n"));

        }
    }
}
  • 2

    Important question: Tried using the Facebook API for this?

  • Jbueno, the API does not let you publish in groups that it is not Admin.

No answers

Browser other questions tagged

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