Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 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. using System.Net;
  11. using Bunifu.Framework.UI;
  12. using SetProxy;
  13. using System.IO;
  14. using System.Threading;
  15. using CefSharp;
  16. using CefSharp.WinForms;
  17.  
  18. namespace UpworkRateQuotesApplication
  19. {
  20. public partial class Form1 : Form
  21. {
  22. List<string> currentQuotes = new List<string>();
  23. int i = 0;
  24. string[] ips = { "54.91.20.17:80", "163.172.136.226:8811", "51.158.68.26:8811", "138.197.161.53:8080", "163.172.152.52:8811" };
  25. /* "144.217.6.80:8080", "54.39.53.104:3128","23.237.173.102:3128",
  26. "159.65.253.109:8080",
  27. "145.239.7.84:3128"};//, ;*/
  28.  
  29. public ChromiumWebBrowser chromeBrowser;
  30.  
  31. private void InitializeChromium()
  32. {
  33. CefSettings settings = new CefSettings();
  34. Cef.Initialize(settings);
  35.  
  36. chromeBrowser = new ChromiumWebBrowser("https://www.quotes.net/authors/Cometan");
  37. this.Controls.Add(chromeBrowser);
  38. chromeBrowser.Dock = DockStyle.Fill;
  39.  
  40. // Bot((WebBrowser)chromeBrowser, "73146");
  41. // chromeBrowser.
  42. // chromeBrowser.
  43. }
  44.  
  45.  
  46. public Form1()
  47. {
  48. InitializeComponent();
  49. //Get latest IE version
  50. /*if (!WBEmulator.IsBrowserEmulationSet())
  51. {
  52. WBEmulator.SetBrowserEmulationVersion();
  53. }
  54. webBrowser1.Url = new Uri("https://www.quotes.net/authors/Cometan");*/
  55. InitializeChromium();
  56. }
  57.  
  58. private void Form1_Load(object sender, EventArgs e)
  59. {
  60. // DataScrapping();
  61. // FillDataGridView();
  62.  
  63. }
  64.  
  65. private void Bot(ChromiumWebBrowser webBrowser, string quoteId)
  66. {
  67. // MessageBox.Show(webBrowser.GetBrowser().MainFrame.ViewSource());
  68. /*foreach (HtmlElement elem in webBrowser.Document.GetElementsByTagName("span"))
  69. {
  70. if (elem.GetAttribute("data-qid") == quoteId)
  71. {
  72. HtmlElementCollection elements = elem.Children;
  73. elements[4].InvokeMember("Click");
  74. }
  75. }*/
  76. }
  77. int a = 0;
  78. private void WebBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  79. {
  80. // if (a >= ips.Length) return;
  81. /*if(webBrowser1.Url != new Uri("https://www.quotes.net/authors/Cometan"))
  82. {
  83. webBrowser1.Url = new Uri("https://www.quotes.net/authors/Cometan");
  84. return;
  85. }*/
  86.  
  87. /* WinInetInterop.SetConnectionProxy(ips[a]);
  88. System.Threading.Thread.Sleep(100);
  89. Bot(webBrowser1, "73043");
  90. MessageBox.Show("Glasano (" + a + ")");*/
  91.  
  92. // a++;
  93. }
  94.  
  95. }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement