Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用HtmlAgilityPack.NET解析iframe中的隐藏字段_C#_Forms_Iframe_Hidden_Html Agility Pack - Fatal编程技术网

C# 使用HtmlAgilityPack.NET解析iframe中的隐藏字段

C# 使用HtmlAgilityPack.NET解析iframe中的隐藏字段,c#,forms,iframe,hidden,html-agility-pack,C#,Forms,Iframe,Hidden,Html Agility Pack,我在挑选iframe表单中需要的数据时遇到问题。甚至可以使用HtmlAgilityPack吗?这是一个使用Firebug的屏幕截图,所以你们更容易看到 我需要解析出post表单id。我已经试过了 var value = doc.DocumentNode.SelectSingleNode("//input[@type='hidden' and @name='post_form_id']") .Attributes["value"].Value; 但显然不起作用,因为它在ifra

我在挑选iframe表单中需要的数据时遇到问题。甚至可以使用HtmlAgilityPack吗?这是一个使用Firebug的屏幕截图,所以你们更容易看到

我需要解析出post表单id。我已经试过了

var value = doc.DocumentNode.SelectSingleNode("//input[@type='hidden' and @name='post_form_id']")
        .Attributes["value"].Value;
但显然不起作用,因为它在iframe表单中。非常感谢您的帮助。

我会的

  • 使用HTMLAglityPack查找iframe位置
  • 使用System.URI类查找iframe页面的绝对链接
  • 打开此iframe页面
  • 在iframe页面上再次使用HTMLAglityPack查找所需信息

  • +1-由于
    IFrame
    的内容是一个单独的文档,因此需要单独加载。