Advertisement
mathiasbk

pokebot

Apr 28th, 2011
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace pokebot
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         bool _newSearchFlag = true;
  20.        
  21.         private void Form1_Load(object sender, EventArgs e)
  22.         {
  23.             webBrowser1.Navigate("http://facebook.com");
  24.         }
  25.        
  26.         private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  27.         {
  28.            
  29.             HtmlElementCollection links = webBrowser1.Document.GetElementsByTagName("a");
  30.  
  31.             foreach (HtmlElement link in links)
  32.             {
  33.              /*  
  34.                 if (link.InnerText.Equals("Poke tilbake"))
  35.                     link.InvokeMember("Click");
  36.                 */
  37.                 if(link.InnerText.Equals("Poke tilbake"))
  38.                 {
  39.                     link.InvokeMember("Click");
  40.                 }
  41.             }
  42.  
  43.  
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement