Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Threading;
- namespace pokebot
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- bool _newSearchFlag = true;
- private void Form1_Load(object sender, EventArgs e)
- {
- webBrowser1.Navigate("http://facebook.com");
- }
- private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
- {
- HtmlElementCollection links = webBrowser1.Document.GetElementsByTagName("a");
- foreach (HtmlElement link in links)
- {
- /*
- if (link.InnerText.Equals("Poke tilbake"))
- link.InvokeMember("Click");
- */
- if(link.InnerText == "Poke tilbake")
- {
- link.InvokeMember("Click");
- Thread.Sleep(300);
- KlikkKnapp("type", "button");
- /*
- HtmlElementCollection pokebtn = webBrowser1.Document.GetElementsByTagName("button");
- foreach (HtmlElement pokes in pokebtn)
- {
- if (pokes.InnerHtml != null)
- {
- // pokes.InvokeMember("Click");
- }
- }
- */
- }
- }
- }
- private void KlikkKnapp(string attributt, string attVerdi)
- {
- foreach (HtmlElement element in this.webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (element.GetAttribute(attributt).Equals(attVerdi))
- {
- element.InvokeMember("click");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement