Advertisement
AhmedSokr

Untitled

Feb 7th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 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.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace instagramID
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void button1_Click(object sender, EventArgs e)
  21. {
  22. webBrowser1.Navigate("https://www.instagram.com/p/" + textBox1.Text + "/");
  23. button2_Click(sender, e);
  24. }
  25.  
  26. private void button2_Click(object sender, EventArgs e)
  27. {
  28. bool F = true;
  29. var linkss = webBrowser1.Document.GetElementsByTagName("button");
  30. foreach (HtmlElement linksd in linkss)
  31. {
  32. if (linksd.GetAttribute("className") == "Z4IfV _0mzm- sqdOP yWX7d ")
  33. {
  34. linksd.InvokeMember("click");
  35. F = false;
  36. }
  37. }
  38.  
  39. if (F)
  40. {
  41. timer1.Start();
  42. }
  43. }
  44.  
  45. private void timer1_Tick(object sender, EventArgs e)
  46. {
  47. var linkss = webBrowser1.Document.GetElementsByTagName("li");
  48. foreach (HtmlElement linksd in linkss)
  49. {
  50. if (linksd.GetAttribute("className") == "gElp9 ")
  51. {
  52. var info = linksd.OuterHtml.Split(new string[] { "title=" }, StringSplitOptions.RemoveEmptyEntries);
  53. if (info != null)
  54. {
  55. string[] Array = { "commenttk", "insta_profille" };
  56. bool f = true;
  57. foreach (var i in info)
  58. foreach (var ia in Array)
  59. if (i.Contains(ia))
  60. f = false;
  61. if (!f)
  62. continue;
  63. var id = info[1].Split(new string[] { "\"" }, StringSplitOptions.RemoveEmptyEntries);
  64. var UserName = id[0];
  65. listBox1.Items.Add(UserName);
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement