How do I extract JS and CSS links from a web page?

"Stephen Cresswell" <[email protected]> Fri, 7 Nov 2008 13:36:56 +0000
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
Hi,

I'm hoping to use HttpUnit to check our application sets response headers
appropriately (especially for caching). To do this I expect to

1. Issue a GET request for http://myapp.com/index.html
2. Interrogate the WebResponse to extract links to images, css and
javascript
3. Issue GET requests for each image, css + js file
4. Re-issue the GET request and assert the response code is 304, and
approprate expires / last modified headers are set.

However I'm having problems obtaining the css and js urls.
WebResponse.getExternalStyleSheet()
only returns the first declaired stylesheet, and I haven't jet found a way
to extract links to scripts.

Any help appreciated,

Thanks,

Steve

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop