How to get an HTML content ?

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
edited June 23, 2004 8:02AM in ANTS Load
Hi Dror,

The HTML of each page that you get back as the result of a GET
request should be stored as a string in the HttpResponse.Content. You should
be able to manipulate the content just like as if you saved the web page to
a file and read it back in as a string, in other words the headers and
status messages are stripped off.

Please let me know if I can offer you any more help in parsing
the page content.



Regards,



Brian Donahue

Technical Support Engineer

Red Gate Software Ltd.

( +44 870 1600 037

( US and CAN 1-866-RED GATE

* mailto:brian.donahue@red-gate.com

"Dror Bareket" <Dror@celebros.com> wrote in message
news:SSANmmEWEHA.1492@server53...
>
>
> Hi all,
>
> 1. I'm using the Ants load project to test a web site.
>
> 2. I've created a script with webClient.Get request for a specific page.
> This page contains html IMG tags concatenated with several parameters.
> The WebClient.Get request is followed by another webClient.Get request
> for a different page using IMG parameters from the first page.
>
> 3. The problem is that those parameters are dynamically created.
>
> 4. In my ants script I'm using the get command as follows:
> WebClient.Get([url=http://]http://[/url]<SERVER_IP>/<MY_SITE>/default.aspx)
> ' I need to get here param1 and param2 from the default.aspx page html
> content before my next Get command:
> WebClient.Get("http://<SERVER_IP>/<SECOND_SITE>/Listener.aspx?param=&quot;
+
> param1 + "&param2="+param2)
>
>
> 5. My question is - Can I get the content of this first page. Or is there
> another way to do this.
>
>
> for ex: can I use VB code to get the content of the requested page,
like
> the following c# code:
>
>
> System.IO.Stream streamReceive = response.GetResponseStream();
> System.Text.Encoding encoding =
> System.Text.Encoding.GetEncoding("utf-8");
> System.IO.StreamReader streamRead = new System.IO.StreamReader(
> streamReceive, encoding);
> // retrieved HTML
> strContent = streamRead.ReadToEnd();
>
>
>
>
> Thanks in advance,
>
>
> Dror Bareket
>
>
> Celebros Ltd. ,Israel
> Phone: +972-9-9555257 ext.120
> Fax: +972-9-9569502
> mailto: dror@celebros.com
> www.celebros.com
>
>
>
>
>
This discussion has been closed.