using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.Navigate("http://w...content-available-to-author-only...m.com/rental/-/detail/=/cid=n_605gnbr2882r/");
}
private void button2_Click(object sender, EventArgs e)
{
HtmlElementCollection elemnts1 =
webBrowser1.Document.Body.GetElementsByTagName("div");
//List<HtmlElement> elemnts2 = new List<HtmlElement>();
foreach (HtmlElement elemnt in elemnts1)
{
string s = elemnt.GetAttribute("className");
if (String.IsNullOrEmpty(s) || !s.Equals("hd-gnav com"))
continue;
//elemnts2.Add(elemnt);
elemnt.OuterHtml = "";
}
//this.Text = elemnts2.Count.ToString();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CgpuYW1lc3BhY2UgV2luZG93c0Zvcm1zQXBwbGljYXRpb24xCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQoKICAgICAgICBwcml2YXRlIHZvaWQgYnV0dG9uMV9DbGljayhvYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIHdlYkJyb3dzZXIxLk5hdmlnYXRlKCJodHRwOi8vdy4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4ubS5jb20vcmVudGFsLy0vZGV0YWlsLz0vY2lkPW5fNjA1Z25icjI4ODJyLyIpOwogICAgICAgIH0KCgogICAgICAgIHByaXZhdGUgdm9pZCBidXR0b24yX0NsaWNrKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgSHRtbEVsZW1lbnRDb2xsZWN0aW9uIGVsZW1udHMxID0KICAgICAgICAgICAgd2ViQnJvd3NlcjEuRG9jdW1lbnQuQm9keS5HZXRFbGVtZW50c0J5VGFnTmFtZSgiZGl2Iik7CiAgICAgICAgICAgIC8vTGlzdDxIdG1sRWxlbWVudD4gZWxlbW50czIgPSBuZXcgTGlzdDxIdG1sRWxlbWVudD4oKTsKICAgICAgICAgICAgZm9yZWFjaCAoSHRtbEVsZW1lbnQgZWxlbW50IGluIGVsZW1udHMxKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBzdHJpbmcgcyA9IGVsZW1udC5HZXRBdHRyaWJ1dGUoImNsYXNzTmFtZSIpOwogICAgICAgICAgICAgICAgaWYgKFN0cmluZy5Jc051bGxPckVtcHR5KHMpIHx8ICFzLkVxdWFscygiaGQtZ25hdiBjb20iKSkKICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKICAgICAgICAgICAgICAgIC8vZWxlbW50czIuQWRkKGVsZW1udCk7CiAgICAgICAgICAgICAgICBlbGVtbnQuT3V0ZXJIdG1sID0gIiI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy90aGlzLlRleHQgPSBlbGVtbnRzMi5Db3VudC5Ub1N0cmluZygpOwogICAgICAgIH0KICAgIH0KfQo=