From: Daniel G. <djg...@gm...> - 2009-03-05 17:23:05
|
Hi J, 1. You might be able to use a falsifying web connection to replace the content of all external JS files with empty strings; you'll still be downloading the files (bad), but HtmlUnit will just execute your empty string, rather than the real JS (good). http://www.nabble.com/What%27s-the-prop-way-to-modify-a-web-response-content-before-htmlunit-constructs-the-page--td21831497.html 2. Post some stack traces, because you shouldn't be getting exceptions thrown in that case. 3. No, just Google it... XPath has been around for a while, so there are tons of miscellaneous resources online. Take care, Daniel On Thu, Mar 5, 2009 at 10:05 AM, J. Stoever <the...@gm...> wrote: > Hi Daniel, > > 1. Unfortunately, I need the scripts on the webpage itself, just not the > remote scripts (as they are mostly ad junk and such) > > 2. Already did that. Still getting exceptions. > > 3. I'll have to look into that. I don't know anything at all about XPath > yet, any advice on what to read ? > > ------------------------------ > *Von:* Daniel Gredler [mailto:djg...@gm...] > *Gesendet:* Thursday, March 05, 2009 3:08 PM > *An:* htm...@li... > *Betreff:* Re: [Htmlunit-user] Three questions - exceptions,tree > navigating and loading of external resources > > Hi J, > > 1. Images are never downloaded, except in rare corner cases; external JS > files are not downloaded if you disable JS on the WebClient; external CSS > files are not downloaded if you disable CSS on the WebClient. > > 2. WebClient.setThrowExceptionOnScriptError(false) > > 3. Not sure about you exact scenario, but DomNode.getByXPath() and > DomNode.getFirstByXPath() are your friends. XPath can be bent to satisfy > most needs :-) > > Take care, > > Daniel > > > > On Thu, Mar 5, 2009 at 5:16 AM, J. Stoever <the...@gm...> wrote: > >> Hi, >> >> I couldn't find the answer to either of this via Google & Co: >> >> External resources: is there a way to prevent WebClient from loading >> external resources such as images and external scripts ? >> >> Exceptions: I sometimes get long exceptions from scripts that don't run >> well. I don't really care about those, since in my case they don't require >> any reaction on my part, so I would like to quiet them, but I can't figure >> out how. Ideas ? >> >> Tree navigating: I'm trying to find a way to, for example, get a list of >> all top level tables, then select one of those tables, get a list of all >> it's subtables, and so on. Unfortuneately, I have only found ways to search >> for ALL children, so my first request returns ALL tables, not just top level >> tables. Any ideas ? >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> >> > > > -- > Daniel Gredler > http://daniel.gredler.net/ > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, > CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source code: > SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > -- Daniel Gredler http://daniel.gredler.net/ |