Beispiel #1
0
        private void parsingButton_Click(object sender, EventArgs e)
        {
            parser.ParserSettings
                = new HabraSettings((int)startNumericUpDown.Value, (int)endNumericUpDown.Value);

            parser.Start();
        }
Beispiel #2
0
        private void ButtonStart_Click(object sender, EventArgs e)
        {
            string numberOfUniversity = "";

            switch (ComboBoxUniversity.Text)
            {
            case "КНУ":
                numberOfUniversity = "538076";
                break;

            case "КНЕУ":
                numberOfUniversity = "574403";
                break;

            case "КНТЕУ":
                numberOfUniversity = "543543";
                break;

            default:
                numberOfUniversity = "538076";
                break;
            }
            parser.Settings = new AbitSettings(numberOfUniversity, 1, 20);



            ListTitles.Items.Clear();
            string header = "Номер\tПріоритет\tБал\tПІБ";

            ListTitles.Items.Add(header);
            ListTitles.Items.Add("");
            AbitParser.amountOfStudentsFirst = 0;
            parser.Start();
        }
Beispiel #3
0
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     CurUrl.changes.Clear();
     CurUrl.urls.Clear();
     ListTitles.Items.Clear();
     CurUrl.iter = (int)NumericStart.Value;
     CurUrl.url  = textBox.Text;
     parser.Start();
 }
Beispiel #4
0
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     parser.Settings = new MetanitSettings(TextBoxCategory.Text,
                                           TextBoxGuide.Text,
                                           (int)NumericStartPart.Value,
                                           (int)NumericEndPart.Value,
                                           (int)NumericStartArticle.Value,
                                           (int)NumericEndArticle.Value);
     parser.Start();
 }
Beispiel #5
0
        // Метод кнопки старт.
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var str1 = Convert.ToInt32(NumericStart.Text);
            var str2 = Convert.ToInt32(NumericEnd.Text);

            var num1 = Convert.ToInt32(str1);
            var num2 = Convert.ToInt32(str2);

            // Пишет настройки парсера.
            parser.Settings = new HabraSettings(num1, num2);
            parser.Start();
        }
Beispiel #6
0
        private void buttonLoad_Click(object sender, EventArgs e)
        {
            try
            {
                if (buttonLoad.Text == "Загрузить")
                {
                    pictureBox.LoadAsync($@"http://loveread.me/img/photo_books/{numericUpDownId.Value}.jpg");
                    //using (WebClient client = new WebClient())
                    //{
                    //скачать всю страницу
                    //    string str = client.DownloadString($@"http://loveread.me/view_global.php?id={numericUpDownId.Value}");
                    //}
                    var    webGet   = new HtmlWeb();
                    var    document = webGet.Load($@"http://loveread.me/view_global.php?id={numericUpDownId.Value}");
                    var    title    = document.DocumentNode.SelectSingleNode("html/head/title").InnerText;
                    string author   = title.Substring(title.IndexOf("Автор книги ", 0) + 12);
                    string name     = title.Substring(13, title.Length - author.Length - 12 - 13);
                    labelTitle.Text = $"{author} - {name}";

                    document = webGet.Load($@"http://loveread.me/read_book.php?id={numericUpDownId.Value}&p=1");
                    var lastPage = document.DocumentNode.SelectSingleNode("html/body/div/div/div/div[2]/div/div/div/div/div[3]/a[10]").InnerText;
                    progressBar.Maximum      = Convert.ToInt32(lastPage);
                    parser_loveread.Settings = new LovereadSettings(1, Convert.ToInt32(lastPage), (int)numericUpDownId.Value);
                    parser_loveread.Start();
                    buttonLoad.Text = "Остановить загрузку";
                }
                else
                {
                    parser_loveread.Stop();
                    buttonLoad.Text = "Загрузить";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Произошла ошибка: {ex.ToString()}. Возможно вы ввели неверный id книги. \nЕсли вы уверены, что id введен верно, обратитесь к разработчику: angel.rudenko.007@m" + "ail.ru", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #7
0
        private void ButtonStart_Click(object sender, EventArgs e)
        {
            parser.Settings = new SearchSettings((int)NumericStart.Value, (int)NumericEnd.Value);
            parser.Start();

            DB           db           = new DB();
            SearchParser searchParser = new SearchParser();

            DataTable table = new DataTable();

            MySqlDataAdapter adapter = new MySqlDataAdapter();

            MySqlCommand command = new MySqlCommand("SELECT * FROM 'prisoners' WHERE 'lastname' = @lt AND 'firstname' = @ft AND 'middlename' = @md AND 'birthday' = @bd AND 'org' = @org AND 'phone' = @ph");

            command.Parameters.Add("@lt", MySqlDbType.VarChar).Value  = searchParser.Equals(searchParser.item1 lastname);
            command.Parameters.Add("@ft", MySqlDbType.VarChar).Value  = searchParser.Equals(searchParser.item2 firstname);
            command.Parameters.Add("@md", MySqlDbType.VarChar).Value  = searchParser.Equals(searchParser.item3 middlename);
            command.Parameters.Add("@bd", MySqlDbType.VarChar).Value  = searchParser.Equals(searchParser.item4 birthday);
            command.Parameters.Add("@org", MySqlDbType.VarChar).Value = searchParser.Equals(searchParser.item5 org);
            command.Parameters.Add("@ph", MySqlDbType.VarChar).Value  = searchParser.Equals(searchParser.item6 phone);

            adapter.SelectCommand = command;
            adapter.Fill(table);
        }
Beispiel #8
0
 public void parseBtn_Click()
 {
     parser.Settings = new ParserSettings("https://rozetka.com.ua/rock_drills/c153621/", "page={CurrentId}", 1, 2);
     parser.Start();
     Console.ReadKey();
 }
Beispiel #9
0
 private void buttonStart_Click(object sender, EventArgs e)
 {
     parser.Settings = new HabraSettings((int)numericStart.Value, (int)numericEnd.Value);
     parser.Start();
 }
Beispiel #10
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     parserWorker.Config.StartPoint = (int)StartPage.Value;
     parserWorker.Config.EndPoint   = (int)EndPage.Value;
     parserWorker.Start();
 }
Beispiel #11
0
        //Поиск по вузам и направлениям. В данном блоке подключаются фильтры и запускается парсинг страницы
        private void ButtonStart_Click(object sender, EventArgs e)
        {
            string filter = null, city = null, BUrl = null;

            if (RadioButtonVUZ1.Checked)
            {
                BUrl = "postupi.online/vuzi/";
            }
            if (RadioButtonProgram2.Checked)
            {
                BUrl = "postupi.online/programmy-obucheniya/bakalavr/";
            }
            if (ComboBoxCity.SelectedIndex == 0)
            {
                city = null;
            }
            if (ComboBoxCity.SelectedIndex == 1)
            {
                city = "msk.";
            }
            if (ComboBoxCity.SelectedIndex == 2)
            {
                city = "spb.";
            }
            if (ComboBoxCity.SelectedIndex == 3)
            {
                city = "ekaterinburg.";
            }
            if (ComboBoxCity.SelectedIndex == 4)
            {
                city = "kazan.";
            }
            if (ComboBoxCity.SelectedIndex == 5)
            {
                city = "nsk.";
            }
            if (ComboBoxCity.SelectedIndex == 6)
            {
                city = "tomsk.";
            }
            if (ComboBoxCity.SelectedIndex == 7)
            {
                city = "samara.";
            }
            if (ComboBoxCity.SelectedIndex == 8)
            {
                city = "rostov.";
            }
            if (ComboBoxCity.SelectedIndex == 9)
            {
                city = "voronezh.";
            }
            if (ComboBoxCity.SelectedIndex == 10)
            {
                city = "krasnodar.";
            }
            if (ComboBoxCity.SelectedIndex == 11)
            {
                city = "krasnoyarsk.";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(0))
            {
                filter += "ege-russkij/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(1))
            {
                filter += "ege-matematika/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(2))
            {
                filter += "ege-obshchestvoznanie/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(3))
            {
                filter += "ege-fizika/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(4))
            {
                filter += "ege-istoriya/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(5))
            {
                filter += "ege-inostrannyj/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(6))
            {
                filter += "ege-informatika/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(7))
            {
                filter += "ege-biologiya/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(8))
            {
                filter += "ege-literatura/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(9))
            {
                filter += "ege-himiya/";
            }
            if (CheckedListBoxEge.CheckedIndices.Contains(10))
            {
                filter += "ege-geografiya/";
            }
            if (RadioButtonOchno3.Checked)
            {
                filter += "forma-ochno/";
            }
            if (RadioButtonZaochno4.Checked)
            {
                filter += "forma-zaochno/";
            }
            if (RadioButtonDist5.Checked)
            {
                filter += "forma-distanc/";
            }
            if (RadioButtonBudget6.Checked)
            {
                filter += "oplata-besplatno/";
            }
            if (RadioButtonPay7.Checked)
            {
                filter += "oplata-platno/";
            }
            if (CheckBoxGos_1.Checked)
            {
                filter += "vuzgos-da/";
            }
            if (CheckBoxArmy_2.Checked)
            {
                filter += "voenkaf-da/";
            }
            if (CheckBoxDorm_3.Checked)
            {
                filter += "obshchezhitie-da/";
            }
            //ListBoxPars.Items.Add("https://"+ city+ BUrl+ filter + "?");
            parser.Settings = new PostupiSettings("https://", city, BUrl, filter + "?");
            parser.Start();
        }
Beispiel #12
0
 private void buttonHabr_Click(object sender, EventArgs e)
 {
     parser_habr.Settings = new HabrSettings((int)numericUpDownStart.Value, (int)numericUpDownEnd.Value);
     parser_habr.Start();
 }
Beispiel #13
0
 private void Button1_Click(object sender, EventArgs e)
 {
     parser.Settings = new HabraSettings((int)numericUpDown1.Value, (int)numericUpDown2.Value);
     parser.Start();
 }
Beispiel #14
0
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     // parser.Settings = new AvitoSettings((int)NumericStart.Value, (int)NumericEnd.Value);
     parser.Settings = new AvitoSettings(Text_Marka.Text, Text_Model.Text, (int)NumericStart.Value, (int)NumericEnd.Value);
     parser.Start();
 }
Beispiel #15
0
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     parser.ParserSettings = new MmoSettings((int)NumericStartPoint.Value, (int)NumericEndPoint.Value);
     parser.Start();
 }