Esempio n. 1
0
        private void btnScrape_Click(object sender, EventArgs e)
        {
            Scraper myScraper = new Scraper();

            string htmlBody = myScraper.GetHtmlFromUrl(JLPT5);

            myKanjiList = myScraper.GetKanjiFromPage(htmlBody, "jlpt5");

            //KanjiListToListView(myKanjiList);
        }
Esempio n. 2
0
        private void btnProcessAll_Click(object sender, EventArgs e)
        {
            Scraper myScraper = new Scraper();
            List<ScrapedKanji> kanjiList = new List<ScrapedKanji>();
            string htmlBody = "";

            folderKanjiDialog.ShowNewFolderButton = true;
            if (folderKanjiDialog.ShowDialog() != DialogResult.Cancel)
            {
                string path = folderKanjiDialog.SelectedPath;
                htmlBody = myScraper.GetHtmlFromUrl(JLPT5);
                kanjiList = myScraper.GetKanjiFromPage(htmlBody, "jlpt5");
                SaveKanjiJsonToDisk(kanjiList, path + "\\jlpt5.json");

                htmlBody = myScraper.GetHtmlFromUrl(JLPT4);
                kanjiList = myScraper.GetKanjiFromPage(htmlBody, "jlpt4");
                SaveKanjiJsonToDisk(kanjiList, path + "\\jlpt4.json");

                htmlBody = myScraper.GetHtmlFromUrl(JLPT3);
                kanjiList = myScraper.GetKanjiFromPage(htmlBody, "jlpt3");
                SaveKanjiJsonToDisk(kanjiList, path + "\\jlpt3.json");

                htmlBody = myScraper.GetHtmlFromUrl(JLPT2);
                kanjiList = myScraper.GetKanjiFromPage(htmlBody, "jlpt2");
                SaveKanjiJsonToDisk(kanjiList, path + "\\jlpt2.json");

                htmlBody = myScraper.GetHtmlFromUrl(JLPT1);
                kanjiList = myScraper.GetKanjiFromPage(htmlBody, "jlpt1");
                SaveKanjiJsonToDisk(kanjiList, path + "\\jlpt1.json");
            }
        }