Advertisement
AhmedSokr

Untitled

Feb 6th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. private void timer1_Tick(object sender, EventArgs e)
  2. {
  3. var linkss = webBrowser1.Document.GetElementsByTagName("lnrre");
  4. foreach (HtmlElement linksd in linkss)
  5. {
  6. if (linksd.InnerText != null)
  7. {
  8. if (linksd.InnerText == "Load more comments")
  9. {
  10. linksd.InvokeMember("click");
  11. }
  12. else
  13. {
  14. timer2.Start();
  15. }
  16. }
  17. }
  18. }
  19. private void timer2_Tick(object sender, EventArgs e)
  20. {
  21. var links = webBrowser1.Document.GetElementsByTagName("li");
  22. foreach (HtmlElement link in links)
  23. {
  24. if (link.GetAttribute("className") == "gElp9")
  25. {
  26.  
  27. var Name = link.InnerHtml.Split(new string[] { "FPmhX notranslate TlrDj" }, StringSplitOptions.RemoveEmptyEntries)[1];
  28. var Name1 = Name.Split(new string[] { "\"" }, StringSplitOptions.RemoveEmptyEntries)[0];
  29. string NAME = Name1;
  30. if (!listBox1.Items.Contains(NAME))
  31. {
  32. C++;
  33. listBox1.Items.Add(NAME);
  34. listBox1.SelectedItem = listBox1.Items[listBox1.Items.Count - 1];
  35. label1.Text = "Count : " + C;
  36. }
  37. else
  38. {
  39. timer2.Stop();
  40. return;
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement