private void PanoramaItem_Loaded(object sender, RoutedEventArgs e) { HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete); htmlDoc.LoadAsync("http://www.cnblogs.com/"); }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete); htmlDoc.LoadAsync("http://q.cnblogs.com/"); }
public void FetchHtml(string url, Object token) { var web = new HtmlWeb(); web.LoadAsync(url); web.LoadCompleted += delegate(object sender, HtmlDocumentLoadCompleted completed) { var htmlDoc = completed.Document; if (htmlDoc.ParseErrors != null && htmlDoc.ParseErrors.Count() > 0) { // Handle any parse errors as required } else { //foreach (var script in htmlDoc.DocumentNode.Descendants("script").ToArray()) // script.Remove(); foreach (var style in htmlDoc.DocumentNode.Descendants("style").ToArray()) style.Remove(); if (htmlDoc.DocumentNode != null) { HtmlNode bodyNode = htmlDoc.DocumentNode.SelectSingleNode("//body"); if (bodyNode != null) { // Do something with bodyNode } } } }; }
/// <summary> /// Retrieves an HtmlDocument using the provided url /// </summary> /// <param name="url">The address to load</param> /// <param name="callback"></param> public static void LoadAsync(string url, EventHandler <HtmlDocumentLoadCompleted> callback) { var web = new HtmlWeb(); web.LoadCompleted += callback; web.LoadAsync(url); }
public void StartPresentationTextRetrieval(string url) { _hw = new HtmlWeb(); _hw.LoadCompleted += hw_LoadCompleted; _hw.LoadAsync(url); }
public static void LoadAsync(string path, CookieContainer container, string[] postVar, EventHandler <HtmlDocumentLoadCompleted> callback) { var web = new HtmlWeb(); web.LoadCompleted += callback; web.LoadAsync(path, container, postVar); }
public override void LoadFromUrl(HtmlWeb web, String url, int pageToLoad = -1) { Url = url; IsLoaded = false; _web = web; _web.LoadCompleted += OnUrlLoaded; _web.LoadAsync(url); }
private void getSearchResult(string searchValueHttpUri, int pageParam) { HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocCompleteSearch); htmlDoc.LoadAsync("http://zzk.cnblogs.com/s?w=" + searchValueHttpUri + "&t=b&p=" + pageParam + ""); }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { //this.IndexPageTextBlock1.Text = "值是---------" + NavigationContext.QueryString["pageValue"]; HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete); htmlDoc.LoadAsync("http://www.cnblogs.com/pick/"); }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { if (NavigationContext.QueryString.Count > 0) { string titleHttpUri = NavigationContext.QueryString["titleLinkValue"]; HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete); htmlDoc.LoadAsync(titleHttpUri); } }
private void FetchSite(object sender, RoutedEventArgs e) { //HtmlWeb.LoadAsync("http://www.google.com", (s, args) => // { // Results.Text = String.Join(Environment.NewLine, // args.Document.DocumentNode.Descendants("a"). // Select( // x => // x.GetAttributeValue("href", "")).ToArray()); // }); var web = new HtmlWeb(); web.LoadCompleted += SiteLoaded; web.LoadAsync("http://www.google.com"); // HtmlWeb.LoadAsync("http://www.google.com", SiteLoaded); }
private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e) { if (NavigationContext.QueryString.Count > 0) { string titleHttpUri = NavigationContext.QueryString["titleLinkValue"]; string questionUrl = "http://q.cnblogs.com"+titleHttpUri; //MessageBox.Show(questionUrl); HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete); htmlDoc.LoadAsync(questionUrl); } }
/// <summary> /// Creates and adds a few ItemViewModel objects into the Items collection. /// </summary> public void LoadData() { HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_RecallListCurrent; webGet.LoadAsync(Url_HealthCanadaProductRecall_2012); webGet.LoadAsync(Url_HealthCanadaProductRecall_2011); HtmlWeb fGet = new HtmlWeb(); fGet.LoadCompleted += parse_RecallListForegin; fGet.LoadAsync(Url_HealthCanadaProductRecall_f2011); HtmlWeb cGet = new HtmlWeb(); cGet.LoadCompleted += load_ConsumerProduct; cGet.LoadAsync(Url_HealthCanadaConsumer); /* HtmlWeb foodGet = new HtmlWeb(); foodGet.LoadCompleted += load_FoodSafety; foodGet.LoadAsync(Url_FoodSafety); */ }
public void getLastestStatus(string trackingnNumber) { HtmlWeb htmlWeb = new HtmlWeb(); htmlWeb.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlWeb_LoadCompleted); htmlWeb.LoadAsync("http://www.verkkoposti.com/e3/TrackinternetServlet?lang=fi&LOTUS_hae=Hae&LOTUS_side=1&LOTUS_trackId=" + trackingnNumber + "&LOTUS_hae=Hae", Encoding.GetEncoding("ISO-8859-1")); }
/// <summary> /// Starts the daily text retrieval. /// </summary> /// <param name="d">The d.</param> public void StartDailyTextRetrieval(DateTime d) { string url = App.Settings.UseCustomDTUrl ? App.Settings.CustomDTUrl : string.Format(StringResources.Application_DailyTextURL, DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day); if (string.IsNullOrEmpty(url)) return; _hw = new HtmlWeb(); _hw.LoadCompleted += hw_LoadCompleted; _hw.LoadAsync(url); }
public static void Scrape(object page) { _page = (MainPage)page; var web = new HtmlWeb(); web.LoadCompleted += ParseBandwidthDocument; var settings = IsolatedStorageSettings.ApplicationSettings; var siteToLoad = "http://netreg.rose-hulman.edu/tools/networkUsage.pl"; web.LoadAsync(siteToLoad, new UTF8Encoding(), (String)settings["user"], (String)settings["pass"], "rose-hulman"); }
protected void LoadUploadPage(HtmlWeb web, String inputPageUrl) { ClearContent(); InputPageUrl = inputPageUrl; _web = web; _web.LoadCompleted += OnUploadPageLoaded; _web.LoadAsync(InputPageUrl); }
public virtual void LoadFromUrl(HtmlWeb web, String url, bool goForward) { ClearContent(); Url = url; _url = url; _web = web; _goForward = goForward; _web.LoadCompleted += OnUrlLoaded; _web.LoadAsync(url); }
public virtual void LoadFromUrl(HtmlWeb web, String url, int pageToLoad = -1) { Url = url; IsLoaded = false; ClearContent(); _pageToLoad = pageToLoad; _web = web; _web.LoadCompleted += OnUrlLoaded; _web.LoadAsync(url); }
private void loadContent(String href) { progress.Visibility = Visibility.Visible; if (App.ViewModel.isStarred(href)) { ApplicationBarIconButton btn = (ApplicationBarIconButton)ApplicationBar.Buttons[3]; btn.IconUri = new Uri("/images/appbar.favs.rest.png", UriKind.Relative); } else { ApplicationBarIconButton btn = (ApplicationBarIconButton)ApplicationBar.Buttons[3]; btn.IconUri = new Uri("/images/appbar.favs.addto.rest.png", UriKind.Relative); } if (DeviceNetworkInformation.IsNetworkAvailable) { if(href.Contains("faqs")){ HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_TalkOriginsContentFAQCompleted; webGet.LoadAsync(href); }else if(href.Contains("indexcc")){ HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_TalkOriginsContentIndexCompleted; webGet.LoadAsync(href); } } }
public void loadPage(String url) { if (!url.Contains("http://wiki.ironchariots.org")) { CurrentPage = IronUrl + url; } else { CurrentPage = url; } if (App.ViewModel.isStarred(CurrentPage)) { ApplicationBarIconButton btn = (ApplicationBarIconButton)ApplicationBar.Buttons[3]; btn.IconUri = new Uri("/images/appbar.favs.rest.png", UriKind.Relative); } else { ApplicationBarIconButton btn = (ApplicationBarIconButton)ApplicationBar.Buttons[3]; btn.IconUri = new Uri("/images/appbar.favs.addto.rest.png", UriKind.Relative); } if (CurrentPage != "") { progress.Visibility = Visibility.Visible; HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_DownloadWikiPageCompleted; webGet.LoadAsync(CurrentPage, Encoding.UTF8); } }
//得到get响应html private void getFlashMemoryList() { HtmlAgilityPack.HtmlWeb htmlDoc = new HtmlAgilityPack.HtmlWeb(); htmlDoc.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(htmlDocComplete); htmlDoc.LoadAsync("http://home.cnblogs.com/ing/mobile/home"); }
private void GetLpgList() { var htmlGet = new HtmlWeb(); htmlGet.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(LpgLoadedHandler); htmlGet.LoadAsync(lpgSite); }
private void GetNgvList() { var htmlGet = new HtmlWeb(); htmlGet.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(NgvLoadedHandler); htmlGet.LoadAsync(ngvSite); }
public void loadPage(String url) { Loading.Visibility = Visibility.Visible; HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_DownloadSEPageCompleted; webGet.LoadAsync(url, Encoding.UTF8); }
public void LoadFromUrl(HtmlWeb web, String url) { ClearContent(); Url = url; _web = web; _web.LoadCompleted += OnUrlLoaded; _web.LoadAsync(Url); }
private void load_ConsumerProduct(object sender, HtmlDocumentLoadCompleted e) { IList<ProductViewModel> tmpItems = new List<ProductViewModel>(); IList<HtmlNode> hnc = e.Document.DocumentNode.DescendantNodes().ToList(); foreach (HtmlNode node in hnc) { if (node.Name.ToLower() == "h2") { if (node.InnerText.Contains("Search Results:")) { String[] strs = node.InnerText.Split(); int max = int.MinValue; foreach (String s in strs) { int tmp; if (int.TryParse(s, out tmp) ) { max = Math.Max(max, tmp); } } if (max != int.MinValue) { if (max % 15 > 1) { max+=15; HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_ConsumerList; webGet.LoadAsync(Url_HealthCanadaConsumer); for (int i = 1; i < max; i += 15) { String url = Url_HealthCanadaConsumer + "&next=t&StartIndex="+ i; webGet.LoadAsync( url ); } } } } } } }
private void GetOilList() { var htmlGet = new HtmlWeb(); htmlGet.LoadCompleted += new EventHandler<HtmlDocumentLoadCompleted>(OilLoadedHandler); htmlGet.LoadAsync(oilSite); }
private void LoadSearchPage(HtmlWeb web) { ClearContent(); _web = web; _searchUrl = String.Format(App.Settings.BuildUrl(_searchUrlTemplate), BoardName, IsClub ? 1 : 0); _web.LoadCompleted += OnSearchPageLoaded; _web.LoadAsync(_searchUrl); }
public void loadPage(String url) { if(url.Contains("http://") ) { CurrentPage = url; }else { CurrentPage = CndHealthSite + url; } if (CurrentPage != "") { if (CurrentPage.Contains("cpsr-rspc")) { LoadingProductScreen.IsOpen = true; HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_ConsumerReportsPageCompleted; webGet.LoadAsync(CurrentPage, Encoding.UTF8); } else { LoadingProductScreen.IsOpen = true; HtmlWeb webGet = new HtmlWeb(); webGet.LoadCompleted += parse_DownloadProductReportPageCompleted; webGet.LoadAsync(CurrentPage, Encoding.UTF8); } } }
public static void LoadAsync(string path, EventHandler<HtmlDocumentLoadCompleted> callback) { var web = new HtmlWeb(); web.LoadCompleted += callback; web.LoadAsync(path); }
private void UpdateServer(object sender, EventArgs e) { stackPanel.Visibility = Visibility.Visible; this.progressBar.IsIndeterminate = true; var wc = new HtmlWeb(); wc.LoadAsync("http://www.cartoesbeneficio.com.br/inst/convivencia/SaldoExtrato.jsp?numeroCartao=" + numero + "", Encoding.UTF8); wc.LoadCompleted += DownloadStringCompleted; }