Beispiel #1
0
 private void Loadeds()
 {
     Webbrowser1.Navigate(Href);
 }
Beispiel #2
0
        private bool GO_58com(List <Class1> L_Class)
        {
            WebClient client = new WebClient();

            client.Encoding = Encoding.UTF8;
            string html = client.DownloadString(URL);

            IHtmlDocument document = new JumonyParser().Parse(html);

            if (document.FindFirst("title").InnerText().Trim() == "请输入验证码")
            {
                this.Dispatcher.Invoke(new Action(() =>
                {
                    DataGrid.Visibility    = Visibility.Collapsed;
                    Webbrowser1.Visibility = Visibility.Visible;
                    Webbrowser1.Navigate(URL);
                }));
                //弹出网站
                //System.Diagnostics.Process.Start(URL);
                return(true);
            }
            else
            {
                IEnumerable <IHtmlElement>  result = document.Find(".house-list-wrap");
                IEnumerable <IHtmlElement>  t      = result.Find("li");
                Dictionary <string, string> dir    = new Dictionary <string, string>();
                foreach (var item in t)
                {
                    #region MyRegion
                    Class1 _class = new Class1();

                    _class.TextName   = GetN_value(item, ".title>a");
                    _class.href       = item.Exists(".title > a") ? item.FindFirst(".title>a").Attribute("href").Value():string.Empty;
                    _class.Quyu       = "同城";
                    _class.PersonName = GetN_value(item, ".jjrname-outer");
                    _class.Laiyuan    = "58";
                    IEnumerable <IHtmlElement> adds  = item.Find(".baseinfo");
                    IEnumerable <IHtmlElement> addsa = adds.Find("a");
                    string adess = "";
                    foreach (var addsaa in addsa)
                    {
                        adess += addsaa.InnerText();
                    }
                    _class.Address = adess;
                    adds.Find("a");
                    string[] ssp = GetN_value(item, ".qj-listright").Split(' ');
                    int      j   = ssp.Length == 10 ? 0 : 10 - ssp.Length;
                    _class.SumMoney  = GetN_value(item, ".sum");
                    _class.PingMoney = GetN_value(item, ".unit");
                    _class.Allpm     = GetN_value(item, ".baseinfo");

                    _class.datetime    = GetN_value(item, ".time");
                    _class.Image_Count = GetInt_value(item, ".picNum");
                    _class.Image_str   = _class.Image_Count > 0 ? "有" : string.Empty;
                    L_Class.Add(_class);
                    r++;
                    #endregion
                }
                return(false);
            }
        }
Beispiel #3
0
 private void Button_Click_8(object sender, RoutedEventArgs e)
 {
     msl = (mshtml.HTMLDocument)Webbrowser1.Document;
     msl.getElementById("keyword1").setAttribute("value", SelectSTR.Text);
     Webbrowser1.InvokeScript("eval", "document.getElementById('searchbtn1').click()");
 }
Beispiel #4
0
 private void GO_58com_new()
 {
     Webbrowser1.Navigate(URL);
 }