ASP.NET敏捷性包|如何解析的网页。即服用后的参数?参数、网页、敏捷性、ASP

2023-09-03 17:21:57 作者:许你春秋

我想分析和网页需要POST参数。就像这是我的情景。我必须解析某些搜索结果。但搜索参数发送后身体到该页面。

I want to parse and page that takes POST parameters. like this is my scenario. i have to parse some search results. but the search parameter are sent in post body to that page.

要分析搜索结果我不得不在POST参数发送到该页面。我怎么能做到这一点敏捷包?

To parse the search result i have to send parameters to that page in POST. how i can do that with agility pack ?

请帮我。

推荐答案

是的,这是可能的,你可以使用HTML敏捷性包后的参数。对低于code一起来看看。

Yes, It is possible, you can post parameters using HTML Agility Pack. Have a look on below code.

BrowserSession b = new BrowserSession();
b.Get("http://www.skyline-eng.com/");
b.FormElements["navigationTypeID"] = rblCategory.SelectedItem.Value;
b.FormElements["navigationSeriesID"] = boxItem.Value;
HtmlDocument docSkyLine = b.Post("http://www.skyline-eng.com/");

下面navigationTypeID和navigationSeriesID是POST参数。这样使用,同时继续使用伟大的工具HTMLAgility包分析数据。

Here navigationTypeID and navigationSeriesID are the post parameters. Use like this and keep parsing data using the great tool HTMLAgility Pack.