예제 #1
0
        public Crawler()
        {
            OnPageInject   = ThreadSafePageInject;
            OnCrawlRequest = ThreadSafeCrawlRequest;

            d_handler = new DownloadHandler();
            d_handler.DownloadHandled += D_handler_DownloadHandled;

            //Initialize the off-screen browser for crawling
            b_root = new ChromiumWebBrowser("local");
            b_root.BrowserSettings.ApplicationCache = CefState.Disabled; //Caching occasionally causes the crawler to miss new files
            b_root.BrowserSettings.ImageLoading     = CefState.Disabled; //We don't want to waste our time/data with pictures :D
            b_root.DownloadHandler = d_handler;
            b_root.JsDialogHandler = new JsDialogHandler();
            b_root.FrameLoadEnd   += b_root_FrameLoadEnd; //This allows us to inject JS in a timely manner
            OnSyncCompleted       += Crawler_OnSyncCompleted;

            this.CreateHandle();
            Application.DoEvents();

            //Form test = new Form();
            //test.Controls.Add(b_root);
            //test.Show();
        }
예제 #2
0
파일: Crawler.cs 프로젝트: Cossa6/truffle
        public Crawler()
        {
            OnPageInject = ThreadSafePageInject;
            OnCrawlRequest = ThreadSafeCrawlRequest;

            d_handler = new DownloadHandler();
            d_handler.DownloadHandled += D_handler_DownloadHandled;

            //Initialize the off-screen browser for crawling
            b_root = new ChromiumWebBrowser("local");
            b_root.BrowserSettings.ApplicationCache = CefState.Disabled; //Caching occasionally causes the crawler to miss new files
            b_root.BrowserSettings.ImageLoading = CefState.Disabled; //We don't want to waste our time/data with pictures :D
            b_root.DownloadHandler = d_handler;
            b_root.JsDialogHandler = new JsDialogHandler();
            b_root.FrameLoadEnd += b_root_FrameLoadEnd; //This allows us to inject JS in a timely manner
            OnSyncCompleted += Crawler_OnSyncCompleted;

            this.CreateHandle();
            Application.DoEvents();

            //Form test = new Form();
            //test.Controls.Add(b_root);
            //test.Show();
        }