How to get a list of links on a webpage

Forum for users of ANTS web server load testing tool

Moderator: Brian Donahue

How to get a list of links on a webpage

Postby lance27 » Wed Feb 28, 2007 4:56 pm

Is there a way to perhaps use the WebClient to fetch an array of found links on a page? Or do I have to parse the returned HTML myself?
lance27
 
Posts: 6
Joined: Wed Feb 28, 2007 4:46 pm

Postby Brian Donahue » Thu Mar 01, 2007 1:58 pm

Hi,

I'm afraid you're right. You would need to parse WebClient.HttpResponse.Content to find the links in a document. If you can figure out a way to take an HTML string and cast it as a mshtml.IHTMLDocument2 object, then that would give you lots of methods to easily parse the HTML. I couldn't figure out how to do this, though.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

How does the script recorder do it?

Postby lance11 » Tue Mar 06, 2007 6:05 pm

Hi Brian,
How does the script recorder do it? As you navigate to different URLs, the recorder creates a script and generates all the fetching of the resources and setting of the header stuff.

I'm thinking that if that process is open to use, I could feed in a list of URLs from the site I want to test, and have the engine create the script for me...

Cunningly,
Lance
lance11
 
Posts: 8
Joined: Wed Feb 28, 2007 4:41 pm

Postby Brian Donahue » Tue Mar 06, 2007 6:44 pm

Script recorder is only trapping post data; that is post data being sent to the server. Data coming back from the server is simply forwarded and ignored.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am


Return to ANTS Load

Who is online

Users browsing this forum: No registered users and 0 guests

cron