当webbrowser遇到iframe要如何解决 目前的问题是用webbrowser打开一个网站后,里边的功能菜单地址都是通过javascript脚本动态生成的,然后再通过iframe打开,先在就是想获取到iframe打开页面的源代码,请各位大侠指点。浏览器JavaScript脚本源代码iframe 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 List<HtmlWindow> res = null; //获取所有的frame private List<HtmlWindow> GetAllWindow(HtmlWindow wb) { List<HtmlWindow> res = new List<HtmlWindow>(); foreach (HtmlWindow item in wb.Document.Window.Frames) { res.Add(item); } foreach (HtmlElement item in wb.Document.All) { if (item.Children.Count > 0) { foreach (HtmlWindow hw in item.Document.Window.Frames) { res.AddRange(GetAllWindow(hw)); } } } return res; }//根据id找控件 public HtmlElement GetById(string Id) { foreach (var item in res) { for (int i = 0; i < item.Document.All.Count; i++) { if (item.Document.All[i].Id == Id) { he = item; return item.Document.All[i]; } } } return null; } 打开页面的源代码你需要找到那个frame找到后htmlWindow有个属性outHtml可以获得当前的html 看看这篇文章:http://blog.csdn.net/dreamclub/article/details/6442478http://blog.csdn.net/xiao_rory/article/details/8059589 哪位大礼帮帮忙,鼠标经过滑出二级菜单,我在二级里嵌套iframe,但鼠标一经过iframe,二级菜单就隐藏了,郁闷中?怎么解决啊 那是不是你在嵌入的页面设置了滑入事件了我以为是当前导航特效引起的,我就再找了个导航特效,还是那样,在弹出层里还是嵌入iframe,问题仍存在,因为iframe不管是天气插件,还是我自个写的空白iframe都一样存在这个问题 <select> 添加问题!!!!!!!!!!!!!!!!! 为什么装好VS2008后出现如下错误 C#还原原来皮肤 一个入门级问题啊[PS:主题到底要多长啊] 如何区分插入光盘和连接移动光驱 客户要求打印的规格是 3800*2810 ,有哪位兄弟有这方面的经验,请接分 急救:重装了IIS后,vs.net2003就不能用了,IIS和本机不能连接!!! ×××××××××××如何在程序结束时关闭所有套接字地址连接?××××××××× 接口的问题。。。。 我做的网址收藏 软件 ,大家看看吧 某个控件隐藏后其相邻的panel自动扩展填充 centos下编译c#工程
List<HtmlWindow> res = null;
//获取所有的frame
private List<HtmlWindow> GetAllWindow(HtmlWindow wb)
{
List<HtmlWindow> res = new List<HtmlWindow>();
foreach (HtmlWindow item in wb.Document.Window.Frames)
{
res.Add(item);
}
foreach (HtmlElement item in wb.Document.All)
{
if (item.Children.Count > 0)
{
foreach (HtmlWindow hw in item.Document.Window.Frames)
{
res.AddRange(GetAllWindow(hw));
}
}
}
return res;
}
//根据id找控件
public HtmlElement GetById(string Id)
{
foreach (var item in res)
{
for (int i = 0; i < item.Document.All.Count; i++)
{
if (item.Document.All[i].Id == Id)
{
he = item;
return item.Document.All[i];
}
}
}
return null;
}
找到后htmlWindow有个属性outHtml可以获得当前的html
http://blog.csdn.net/xiao_rory/article/details/8059589
我以为是当前导航特效引起的,我就再找了个导航特效,还是那样,在弹出层里还是嵌入iframe,问题仍存在,因为iframe不管是天气插件,还是我自个写的空白iframe都一样存在这个问题