You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
(17) |
Aug
(18) |
Sep
(22) |
Oct
(16) |
Nov
(6) |
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(10) |
Mar
(34) |
Apr
(26) |
May
(6) |
Jun
(22) |
Jul
(14) |
Aug
(4) |
Sep
(47) |
Oct
(69) |
Nov
(23) |
Dec
(21) |
2005 |
Jan
(53) |
Feb
(33) |
Mar
(92) |
Apr
(65) |
May
(63) |
Jun
(57) |
Jul
(43) |
Aug
(132) |
Sep
(61) |
Oct
(75) |
Nov
(60) |
Dec
(130) |
2006 |
Jan
(74) |
Feb
(87) |
Mar
(101) |
Apr
(58) |
May
(54) |
Jun
(42) |
Jul
(31) |
Aug
(67) |
Sep
(61) |
Oct
(71) |
Nov
(28) |
Dec
(58) |
2007 |
Jan
(53) |
Feb
(50) |
Mar
(96) |
Apr
(66) |
May
(55) |
Jun
(130) |
Jul
(99) |
Aug
(115) |
Sep
(37) |
Oct
(78) |
Nov
(24) |
Dec
(70) |
2008 |
Jan
(94) |
Feb
(85) |
Mar
(197) |
Apr
(274) |
May
(119) |
Jun
(143) |
Jul
(193) |
Aug
(99) |
Sep
(160) |
Oct
(120) |
Nov
(178) |
Dec
(109) |
2009 |
Jan
(238) |
Feb
(169) |
Mar
(115) |
Apr
(109) |
May
(131) |
Jun
(167) |
Jul
(144) |
Aug
(193) |
Sep
(155) |
Oct
(154) |
Nov
(97) |
Dec
(127) |
2010 |
Jan
(108) |
Feb
(127) |
Mar
(176) |
Apr
(113) |
May
(130) |
Jun
(200) |
Jul
(115) |
Aug
(80) |
Sep
(92) |
Oct
(101) |
Nov
(124) |
Dec
(53) |
2011 |
Jan
(67) |
Feb
(144) |
Mar
(88) |
Apr
(60) |
May
(89) |
Jun
(54) |
Jul
(68) |
Aug
(81) |
Sep
(48) |
Oct
(40) |
Nov
(10) |
Dec
(20) |
2012 |
Jan
(21) |
Feb
(28) |
Mar
(17) |
Apr
(35) |
May
(41) |
Jun
(44) |
Jul
(68) |
Aug
(67) |
Sep
(89) |
Oct
(58) |
Nov
(47) |
Dec
(56) |
2013 |
Jan
(49) |
Feb
(28) |
Mar
(46) |
Apr
(31) |
May
(28) |
Jun
(37) |
Jul
(34) |
Aug
(52) |
Sep
(42) |
Oct
(108) |
Nov
(59) |
Dec
(56) |
2014 |
Jan
(41) |
Feb
(72) |
Mar
(46) |
Apr
(21) |
May
(19) |
Jun
(17) |
Jul
(15) |
Aug
(40) |
Sep
(11) |
Oct
(3) |
Nov
(5) |
Dec
(31) |
2015 |
Jan
(11) |
Feb
(12) |
Mar
(19) |
Apr
(19) |
May
(38) |
Jun
(54) |
Jul
(14) |
Aug
(42) |
Sep
(14) |
Oct
(16) |
Nov
(26) |
Dec
(14) |
2016 |
Jan
(3) |
Feb
(1) |
Mar
(24) |
Apr
(5) |
May
(15) |
Jun
(14) |
Jul
(33) |
Aug
(19) |
Sep
(8) |
Oct
(10) |
Nov
|
Dec
(2) |
2017 |
Jan
(16) |
Feb
(12) |
Mar
(23) |
Apr
(8) |
May
(11) |
Jun
(20) |
Jul
(21) |
Aug
(20) |
Sep
|
Oct
(6) |
Nov
(9) |
Dec
(2) |
2018 |
Jan
(7) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
|
Dec
(4) |
2019 |
Jan
(2) |
Feb
(2) |
Mar
(3) |
Apr
(4) |
May
|
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(7) |
2020 |
Jan
(2) |
Feb
(6) |
Mar
(9) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(6) |
Nov
(3) |
Dec
(5) |
2021 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brehm, R. P <rob...@of...> - 2004-09-27 17:13:20
|
Brad C, Here is the failing JUnit test. By the way I am running version 1.2.3. Best Regards, Bob Brehm Software Engineer Xerox Corp. /* * Created on Sep 17, 2004 * */ package junit; import junit.framework.TestCase; import com.gargoylesoftware.htmlunit.*; import com.gargoylesoftware.htmlunit.html.*; import java.net.URL; import java.util.*; /** * @author rbrehm * */ public class LoginJSPHTMLTestJavaScript extends TestCase { public void testLoginPageJavaScript() throws Exception { String LoginFormURL = "http://localhost:8080/Logistics_JSP/"; WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); webClient.setJavaScriptEnabled(true); webClient.setThrowExceptionOnFailingStatusCode(true); webClient.setRedirectEnabled(true); URL url = new URL(LoginFormURL); HtmlPage page = (HtmlPage)webClient.getPage(url); ArrayList arr = (ArrayList) page.getAllForms(); HtmlForm form = (HtmlForm) arr.get(0); assertEquals("loginForm",form.getNameAttribute()); // assertEquals( "Login Page", page.getTitleText()); HtmlButtonInput buttonInput= (HtmlButtonInput) form.getInputByName("loginSubmit"); assertNotNull(buttonInput); form.getInputByName("userName").setValueAttribute("rbrehm"); form.getInputByName("userPassword").setValueAttribute("<password>"); HtmlPage page2 = (HtmlPage) buttonInput.click(); form = page2.getFormByName("headerForm"); assertEquals("headerForm",form.getNameAttribute()); buttonInput= (HtmlButtonInput) form.getInputByName("Logout"); HtmlPage page3 = (HtmlPage) buttonInput.click(); ArrayList arr3 = (ArrayList) page3.getAllForms(); form = (HtmlForm) arr3.get(0); assertEquals("loginForm",form.getNameAttribute()); }//method }//class |
From: Mike B. <mb...@Ga...> - 2004-09-26 19:09:37
|
HtmlUnit-1.3-pre2 has been released. A full list of changes can be found at... http://htmlunit.sourceforge.net/changes-report.html -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Mike B. <mb...@Ga...> - 2004-09-26 18:59:29
|
For those who haven't seen it already, the recently released "JUnit Recipes" by J.B. Rainsberger provides quite a few recipes that use HtmlUnit for testing. http://www.amazon.com/exec/obidos/tg/detail/-/1932394230/qid=1096224994/sr=8-1/ref=pd_ka_1/102-6058448-9644944?v=glance&s=books&n=507846 or http://tinyurl.com/6fmzf -- Mike Bowler Principal, Gargoyle Software Inc. Voice: (416) 822-0973 | Email : mb...@Ga... Fax : (416) 822-0975 | Website: http://www.GargoyleSoftware.com |
From: Your G. <yo...@br...> - 2004-09-24 21:47:47
|
I know there is currently a problem with javascript doing document.write and then expecting the things it just wrote to appear in the DOM. Could you put this in the form of a failing test? Brad C --- "Brehm, Robert P" <rob...@of...> wrote: > All, > > I am having difficulties running the following dynamic javascript code from an > input button (loginSubmit) onclick event called HandleSubmit(): > > function HandleSubmit() { > var userName = document.loginForm.userName.value; > var userPassword = document.loginForm.userPassword.value; > document.write("<form name=\"loginForm\">"); > ... > document.write("</form>"); > document.loginForm.userName.value = userName; > document.loginForm.userPassword.value = userPassword; > document.loginForm.loginSubmit.disabled = true; > document.loginForm.userName.disabled = true; > document.loginForm.userPassword.disabled = true; > location.href="login.jsp?userName="+userName+"&userPassword="+userPassword; > }//function > > What I would like to do is to capture the HTML in the GET response generated by > location.href by the following snippet: > > HtmlButtonInput buttonInput= (HtmlButtonInput) > form.getInputByName("loginSubmit"); > form.getInputByName("userName").setValueAttribute("name"); > form.getInputByName("userPassword").setValueAttribute("pwd"); > HtmlPage page2 = (HtmlPage) buttonInput.click(); > > Instead what happens is that the captured HTML is the output from the above > document.write() lines. Any help would be appreciated in overcoming this > obstacle! > > Cheers, > > Bob Brehm > Software Engineer > Xerox Corp. > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Brehm, R. P <rob...@of...> - 2004-09-23 22:08:45
|
All, I am having difficulties running the following dynamic javascript code from an input button (loginSubmit) onclick event called HandleSubmit(): function HandleSubmit() { var userName = document.loginForm.userName.value; var userPassword = document.loginForm.userPassword.value; document.write("<form name=\"loginForm\">"); ... document.write("</form>"); document.loginForm.userName.value = userName; document.loginForm.userPassword.value = userPassword; document.loginForm.loginSubmit.disabled = true; document.loginForm.userName.disabled = true; document.loginForm.userPassword.disabled = true; location.href="login.jsp?userName="+userName+"&userPassword="+userPassword; }//function What I would like to do is to capture the HTML in the GET response generated by location.href by the following snippet: HtmlButtonInput buttonInput= (HtmlButtonInput) form.getInputByName("loginSubmit"); form.getInputByName("userName").setValueAttribute("name"); form.getInputByName("userPassword").setValueAttribute("pwd"); HtmlPage page2 = (HtmlPage) buttonInput.click(); Instead what happens is that the captured HTML is the output from the above document.write() lines. Any help would be appreciated in overcoming this obstacle! Cheers, Bob Brehm Software Engineer Xerox Corp. |
From: Your G. <yo...@br...> - 2004-09-22 20:10:21
|
Sorry for the delay; had an email server crash and lost a few messages so this is the first I saw :( There was a patch for setInterval() submitted a long-long time ago but it wouldn't apply and left a thread running so it was rejected. If you have a patch that in any way makes things better than they are please post it to the patch tracker and I'll get it applied ASAP. This will get it into the nightly build and I'm hoping to do a release of some sort next week if our fearless leader doesn't beat me to it :p (I'm in the process of moving right now so time is limited). What's this <DIV...> problem?? Brad C --- "David D. Kilzer" <ddk...@ki...> wrote: > Stubbing out support for the "setInterval()" method would also fix some > of the tests that hit various CNN web sites in the SanityCheck test > class. (The JavaScript actually appears in banner ads for those sites!) > > I thought someone already uploaded a patch for this, but I can't find > any relevent Bugs, Patches or RFEs on the SourceForge project site. > > Dave > > > On Sun, Sep 19, 2004 at 08:13:04PM +0200, Klaus-Peter Berg wrote: > > > Hi Chris, > > > > unfortenately, this is little help provided by the htmlunit developer guys ;-( > > I know that there is the setJavaScriptEnabled(false) feature, but sometimes I > NEED JS execution! > > E.g., my code does not work because the <DIV ...> statement is not processed > properly, or another piece of code does not work because Window.setInterval() is > missing. > > > > So I decided to go the hard way and patch the code by myself! > > In the case of the <DIV...> statement I have already succeeded to write a > workaround, and setInterval() is on the way... > > Seems that is what open source is all about... > > > > --Klaus |
From: <ddk...@ki...> - 2004-09-22 19:27:46
|
Stubbing out support for the "setInterval()" method would also fix some of the tests that hit various CNN web sites in the SanityCheck test class. (The JavaScript actually appears in banner ads for those sites!) I thought someone already uploaded a patch for this, but I can't find any relevent Bugs, Patches or RFEs on the SourceForge project site. Dave On Sun, Sep 19, 2004 at 08:13:04PM +0200, Klaus-Peter Berg wrote: > Hi Chris, > > unfortenately, this is little help provided by the htmlunit developer guys ;-( > I know that there is the setJavaScriptEnabled(false) feature, but sometimes I NEED JS execution! > E.g., my code does not work because the <DIV ...> statement is not processed properly, or another piece of code does not work because Window.setInterval() is missing. > > So I decided to go the hard way and patch the code by myself! > In the case of the <DIV...> statement I have already succeeded to write a workaround, and setInterval() is on the way... > Seems that is what open source is all about... > > --Klaus |
From: Klaus-Peter B. <126...@on...> - 2004-09-19 18:18:21
|
Hi Chris, soory, but part of my last message seemed to be corrupted. So here = again: unfortenately, there is little help provided by the htmlunit developer = guys ;-( I know that there is the setJavaScriptEnabled(false) feature, but = sometimes I NEED JS execution! E.g., my code does not work because the <DIV ...> statement is not = processed properly, or another piece of code does not work because = Window.setInterval() is missing. So I decided to go the hard way and patch the code by myself! In the case of the <DIV...> statement I have already succeeded to write = a workaround, and setInterval() is on the way... Seems that is what open source is all about... --Klaus |
From: Klaus-Peter B. <Kla...@we...> - 2004-09-19 18:13:18
|
Hi Chris, unfortenately, this is little help provided by the htmlunit developer guys ;-( I know that there is the setJavaScriptEnabled(false) feature, but sometimes I NEED JS execution! E.g., my code does not work because the <DIV ...> statement is not processed properly, or another piece of code does not work because Window.setInterval() is missing. So I decided to go the hard way and patch the code by myself! In the case of the <DIV...> statement I have already succeeded to write a workaround, and setInterval() is on the way... Seems that is what open source is all about... --Klaus _________________________________________________________ Mit WEB.DE FreePhone? mit hochster Qualitat ab 0 Ct./Min. weltweit telefonieren! http://freephone.web.de/?mc=021201 |
From: Erskine, C. <chr...@ed...> - 2004-09-17 17:44:10
|
Since no one has bothered to respond to you on this (I am trying to also work on using the javascript), you can disable the javascript itself by using the line webClient.setJavaScriptEnabled(false); in your code. In looking at the documentation, it is looking like there are a number of objects that are still not implemented such as Buttons, Checkbox, Image and more. Chris Erskine EDS Consulting Services F5-EDS-001 2424 Garden of the Gods Rd Colorado Springs, CO 80919 Phone: 719-535-6064 Phone: mailto:chr...@ed... -----Original Message----- From: Berg Klaus-Peter [mailto:kla...@si...] Sent: Thursday, September 16, 2004 7:43 AM To: 'htm...@li...' Subject: [Htmlunit-user] How to disable ECMA-Errors in the JavaScript engine? Hi all, I'm using htmlunit-1.2.3 with js-1.5R4.1.jar. Newer versions of the Rhino engine seem not to be compatible with this htmlunit release. Loading a page generated by the Liferay portal server I got an ECMA-error: EcmaError: lineNumber=[155] column=[0] lineSource=[ setInterval("blink()", 750);] name=[ReferenceError] sourceName=[/html/js/util.js] message=["setInterval" is not defined.] errorObject=[ReferenceError: "setInterval" is not defined.]com.gargoylesoftware.htmlunit.ScriptException: "setInterval" is not defined. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:250) because there is really no definition for the setInterval(..) function in the js file mentioned above. Nevertheless, the only place where this function is called is in a conditional statement: if (document.all) { setInterval("blink()", 750); } InternetExplorer has no problems with the page and the js file, so has anyone an idea how to disable ECMA checking in htmlunit, otherwise it seems that I will not be able to load the Liferay page successully with this framework... --Klaus Software development is fundamentally hard. -- Grady Booch ------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Berg Klaus-P. <kla...@si...> - 2004-09-16 13:42:57
|
Hi all, I'm using htmlunit-1.2.3 with js-1.5R4.1.jar. Newer versions of the Rhino engine seem not to be compatible with this htmlunit release. Loading a page generated by the Liferay portal server I got an ECMA-error: EcmaError: lineNumber=[155] column=[0] lineSource=[ setInterval("blink()", 750);] name=[ReferenceError] sourceName=[/html/js/util.js] message=["setInterval" is not defined.] errorObject=[ReferenceError: "setInterval" is not defined.]com.gargoylesoftware.htmlunit.ScriptException: "setInterval" is not defined. at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript Engine.java:250) because there is really no definition for the setInterval(..) function in the js file mentioned above. Nevertheless, the only place where this function is called is in a conditional statement: if (document.all) { setInterval("blink()", 750); } InternetExplorer has no problems with the page and the js file, so has anyone an idea how to disable ECMA checking in htmlunit, otherwise it seems that I will not be able to load the Liferay page successully with this framework... --Klaus Software development is fundamentally hard. -- Grady Booch |
From: Chris E. <chr...@ed...> - 2004-09-16 12:56:40
|
I found the problem. The doco on the web site is wrong. On the http://htmlunit.sourceforge.net/buildingFromCvs.html page, it should be cvs.sourceforge.net. On Wed, 15 Sep 2004 16:45:13 -0600, Chris Erskine <chr...@ed...> wrote: >Has something changed for getting the source? I am trying to get a copy of the >current source and am getting connection timeouts just trying to login. I am >using the following command: >cvs -d:pserver:ano...@cv...:/cvsroot/htmlunit login > >Chris > > > >------------------------------------------------------- >This SF.Net email is sponsored by: thawte's Crypto Challenge Vl >Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam >Camcorder. More prizes in the weekly Lunch Hour Challenge. >Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m |
From: Chris E. <chr...@ed...> - 2004-09-15 23:00:20
|
Has something changed for getting the source? I am trying to get a copy of the current source and am getting connection timeouts just trying to login. I am using the following command: cvs -d:pserver:ano...@cv...:/cvsroot/htmlunit login Chris |
From: Gary L. <ch...@ya...> - 2004-09-14 01:47:24
|
messed around and found that com.gargoylesoftware.htmlunit.html.HtmlForm might be improved by the following change: public Collection getAllSubmittableElements() { final List submittableElements = getHtmlElementsByTagNames(Arrays.asList( new String[]{"input", "button", "select", "textarea", "isindex"} )); if(submittableElements == null || submittableElements.size() ==0) { return new ArrayList(); } return submittableElements; } Unless I am wrong, which is likely because I've been working with the API for 2 hours only, getHtmlElementsByTagNames(List acceptableTagNames) gets all the appropriate form elements wherever they may be hiding. The current usage, at least in my source (htmlunit-1.3-pre1) uses getChildElementsIterator(). Anyway, give it a look see if you want. Let me know if there's anything I am missing. thanks g ===== ------ A ship is safest in the harbour, but that's not what ships are built for. It's 2001, you better know where your groove is. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail |
From: Gary L. <ch...@ya...> - 2004-09-13 21:44:54
|
Hey all, Unless I am mistaken, HtmlForm.getAllSubmittableElements() iterates over only one level of decendant children (if that's the correct wya to put it), and doesn't check deeper into the DOM for submittable form elements. Is this true? example: <form blah> <div onlyChild> <span spanBlah>text<span> <table twoBlah> <tr threeblah> <td fourBlah> <input bingo></td> <td fourBlah> <input type="image" id="clickMe"></td> </tr> </table> </div> </form> in the case above if I were to click on the image with id "clickMe" getAllSubmittableElements() gets called during the call to [submit( final SubmittableElement submitElement )] where the element submitted is the "clickMe" image. getAllSubmittableElements() calls getChildElementsIterator() which gives me an iterator over what appears to be the only child, the div "onlyChild" (nice name, eh?). So, while the image name gets submitted, the value of the input "bingo" doesn't. of course the resaon I ask this is that I am trying to get HtmlUnit running on our current application and I can't edit text values. The pages have a large number of form elements of all types and they are firmly embedded deep within every kind of html tag. HttpUnit works great for us for checking form values and such, but is a bear when we want to check anything else on the page. Any clues as to how to submit the form values from within deeply embedded html elments? thanks gary ===== ------ A ship is safest in the harbour, but that's not what ships are built for. It's 2001, you better know where your groove is. _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com |
From: Klaus-Peter B. <Kla...@we...> - 2004-09-05 11:31:39
|
Hello Andrey, thanks for this examination. The problem is: I have have no influence on how "onsubmit" is provided, as "onSubmit" or all in lower case as "onsubmit". So, there must be a way to deal with mixed case HTML, i.g., converting all HTML to lowercase.! In the new book "JUnit Recipes" I read something like changing the htlmunit parser ... or using some special options. On the other hand, I will try to enable logging to get more detailed output. What happened now is: no error page or something bad, after searchbutton.click() is called I will get the SAME page that I have sent before, but no input parameter substitution has taken place. This is because the corresponding javascript function ac not been executed... --Klaus _______________________________________________________ WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern Informationen unter: http://freemail.web.de/?mc=021199 |
From: Dan T. <dan...@ho...> - 2004-09-04 03:28:01
|
enter your email in "edit option" at the bottom of that screen. -Dan ----- Original Message ----- From: "Biju Arjunan" <bij...@ya...> To: <htm...@li...> Sent: Friday, September 03, 2004 12:22 AM Subject: Re: [Htmlunit-user] unsubscribe > Where to find unsubscribe information about this > group. > unfortunately the URL > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > don't have unsubscribe option. > > > --- Vera Mickael <mv...@ge...> wrote: > > > > > > > Bruce Faulkner wrote: > > > > > And, of course, if you really wanted the > > HtmlAnchor objects rather than the HtmlLink objects, > > then it is even easier: > > > > > > List anchorList = myPage.getAnchors(); > > > > > > Bruce > > > -- > > > Bruce Faulkner > > > SAS Institute Inc. > > > > > > -----Original Message----- > > > From: htm...@li... > > [mailto:htm...@li...] > > On Behalf Of Bruce Faulkner > > > Sent: Wednesday, September 01, 2004 8:23 AM > > > To: htm...@li... > > > Subject: RE: [Htmlunit-user] Getting all the > > Anchor (HTMLLinks) on a page? > > > > > > > > > Something like the following code should give what > > you need: > > > > > > List linkList = > > > myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > > > Where myPage is an instance of an HtmlPage. > > > > > > Bruce > > > -- > > > Bruce Faulkner > > > SAS Institute Inc. > > > -----Original Message----- > > > From: htm...@li... > > [mailto:htm...@li...] > > On Behalf Of Robert Baccus > > > Sent: Tuesday, August 31, 2004 8:13 PM > > > To: htm...@li... > > > Subject: [Htmlunit-user] Getting all the Anchor > > (HTMLLinks) on a page? > > > > > > > > > I noticed that HTMLUnit has the > > HtmlPage.getFirstAnchorByText(String text) method. > > But what I am trying to accomplish is to parse the > > whole page and pull out all of the HTMLLinks and put > > them into a list. Can this easily be done? > > > > > > Thanks. > > > > > > ===== > > > Rob Baccus > > > Email: rb...@go... > > > > > > > > > > > > __________________________________ > > > Do you Yahoo!? > > > Read only the mail you want - Yahoo! Mail > > SpamGuard. http://promotions.yahoo.com/new_mail > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by BEA Weblogic > > Workshop > > > FREE Java Enterprise J2EE developer tools! > > > Get your free copy of BEA WebLogic Workshop 8.1 > > today. > > > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > > > _______________________________________________ > > > Htmlunit-user mailing list > > > Htm...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by BEA Weblogic > > Workshop > > > FREE Java Enterprise J2EE developer tools! > > > Get your free copy of BEA WebLogic Workshop 8.1 > > today. > > http://ads.osdn.com/?ad_idP47&alloc_id808&op=ick > > > _______________________________________________ > > > Htmlunit-user mailing list > > > Htm...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by BEA Weblogic > > Workshop > > > FREE Java Enterprise J2EE developer tools! > > > Get your free copy of BEA WebLogic Workshop 8.1 > > today. > > > > > http://ads.osdn.com/?ad_idP47&alloc_id808&op=click > > > _______________________________________________ > > > Htmlunit-user mailing list > > > Htm...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic > > Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 > > today. > > > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > > _______________________________________________ > > Htmlunit-user mailing list > > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > __________________________________ > Do you Yahoo!? > New and Improved Yahoo! Mail - Send 10MB messages! > http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Andrey S. <asu...@oi...> - 2004-09-03 08:45:48
|
Er, after taking a second and a third look at your code, I understood that my previous letter missed the point. While onSubmit is still wrong, your problem happens somewhere else. The misnamed onsubmit is simply ignored, and the code should proceed directly to action. What do you mean by "not called"? Does absolutely nothing? Fails with exception? prints something to log? From the first look, the quoted pieces should generally work. In particular, image buttons are supported and, when clicked, should submit the form; form action can be a javascript:foo() url; and assigning new url to document.location.href is supported. I expect that doSearch() itself is called, but an error happens somewhere along the way. I would recommend registering an AlertHandler by calling aWebClient.setAlertHandler(h) that prints alert text to System.out. Then systematically insertng alert() in javascript to pinpoint the error. This is what I do when something strange happens in tested pages (i.e. all the time :). Also make sure that your HtmlUnit logging is enabled. Maybe add assertTrue(aWebClient.getLog().isErrorEnabled()) to your test. Andrey |
From: Biju A. <bij...@ya...> - 2004-09-03 07:22:46
|
Where to find unsubscribe information about this group. unfortunately the URL https://lists.sourceforge.net/lists/listinfo/htmlunit-user don't have unsubscribe option. --- Vera Mickael <mv...@ge...> wrote: > > > Bruce Faulkner wrote: > > > And, of course, if you really wanted the > HtmlAnchor objects rather than the HtmlLink objects, > then it is even easier: > > > > List anchorList = myPage.getAnchors(); > > > > Bruce > > -- > > Bruce Faulkner > > SAS Institute Inc. > > > > -----Original Message----- > > From: htm...@li... > [mailto:htm...@li...] > On Behalf Of Bruce Faulkner > > Sent: Wednesday, September 01, 2004 8:23 AM > > To: htm...@li... > > Subject: RE: [Htmlunit-user] Getting all the > Anchor (HTMLLinks) on a page? > > > > > > Something like the following code should give what > you need: > > > > List linkList = > myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > > Where myPage is an instance of an HtmlPage. > > > > Bruce > > -- > > Bruce Faulkner > > SAS Institute Inc. > > -----Original Message----- > > From: htm...@li... > [mailto:htm...@li...] > On Behalf Of Robert Baccus > > Sent: Tuesday, August 31, 2004 8:13 PM > > To: htm...@li... > > Subject: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > > > > I noticed that HTMLUnit has the > HtmlPage.getFirstAnchorByText(String text) method. > But what I am trying to accomplish is to parse the > whole page and pull out all of the HTMLLinks and put > them into a list. Can this easily be done? > > > > Thanks. > > > > ===== > > Rob Baccus > > Email: rb...@go... > > > > > > > > __________________________________ > > Do you Yahoo!? > > Read only the mail you want - Yahoo! Mail > SpamGuard. http://promotions.yahoo.com/new_mail > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic > Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 > today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > > _______________________________________________ > > Htmlunit-user mailing list > > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic > Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 > today. > http://ads.osdn.com/?ad_idP47&alloc_id808&op=ick > > _______________________________________________ > > Htmlunit-user mailing list > > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic > Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 > today. > > > http://ads.osdn.com/?ad_idP47&alloc_id808&op=click > > _______________________________________________ > > Htmlunit-user mailing list > > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic > Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 > today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail |
From: Andrey S. <asu...@oi...> - 2004-09-03 05:35:30
|
Accodring to HTML DOM all attribute names must be lowercase. Try "onsubmit" instead of "onSubmit". This is the name HtmlUnit looks for in HtmlForm.getOnSubmitAttribute method. > I have tried to run htmlunit with javascript but encountered that the > expected javascript method (doSearch() in this case) will not be called. > Perhaps, someone has an idea what went wrong... ... > <form action="javascript:doSearch (document.sform);" method="post" > name="sform" id="sform" onSubmit="return checkTheQuery (this);"> |
From: Berg Klaus-P. <kla...@si...> - 2004-09-02 14:57:47
|
Hi all, I have tried to run htmlunit with javascript but encountered that the expected javascript method (doSearch() in this case) will not be = called. Perhaps, someone has an idea what went wrong... Here is the code snipped: public class WebUITest3 extends TestCase { private WebClient webClient; protected void setUp() throws Exception { webClient =3D new = WebClient(BrowserVersion.INTERNET_EXPLORER_6_0); webClient.setRedirectEnabled(true); webClient.setJavaScriptEnabled(true); } public void testSendLogonPage() throws Exception { URL url =3D new URL("http://xyz/index.html"); Page page =3D webClient.getPage(url); final HtmlPage logonPage =3D (HtmlPage) page; =20 final HtmlForm form =3D logonPage.getFormByName("sform"); // Now change the desired input field final HtmlTextInput textField =3D (HtmlTextInput) form.getInputByName("SearchWhat"); textField.setValueAttribute("test"); HtmlInput searchButton =3D form.getInputByName("submit"); assertTrue("Search button is not an image", searchButton instanceof HtmlImageInput); final Page resultPage =3D searchButton.click(); // emulate user clicking "start search" image button // verify search result ... } } and part of the HTML page being called: function checkQueryText (textElement) { if (textElement.length < 2) { return false } else { return true } } function checkTheQuery (myform) { var queryOK; queryOK =3D checkQueryText (myform ["SearchWhat"].value); if (! queryOK) { alertText =3D "Bitte geben Sie einen Suchbegriff ein, der l=E4nger 1 Zeichen ist."; //alertText =3D "Please enter a search term longer than 1 character."; alert (alertText); }=20 return (queryOK) } function doSearch (myform) { v_url =3D v_url + "pg=3Daq";// pg=3Daq (advanced query) v_url =3D v_url + "&catfilter=3Duser";// catfilter=3Duser (use the = filter from customcategorieval) queryString =3D myform ["SearchWhat"].value; v_url =3D v_url + "&customcategorieval=3D" + webify (website); v_url =3D v_url + "&customcategoriedisp=3D" + webify (categorie); v_url =3D v_url + "&q=3D" + webify (queryString); v_url =3D v_url + "&nolanguage=3DTrue"; v_url =3D v_url + "&noquicktips=3DTrue"; v_url =3D v_url + "&nokeywordindex=3DTrue"; v_url =3D v_url + "&uil=3Dde"; window.location.href =3D v_url;=20 } <form action=3D"javascript:doSearch (document.sform);" method=3D"post" name=3D"sform" id=3D"sform" onSubmit=3D"return checkTheQuery (this);"> <td width=3D"*" colspan=3D"2" bgcolor=3D"#ffcc99"><table border=3D"0" cellspacing=3D"0" cellpadding=3D"0"> <tr> <td><img src=3D"/cti/images/common/1x1_blank.gif" height=3D"1" width=3D"18" border=3D"0"></td> <td nowrap><input type=3D"text" name=3D"SearchWhat" maxlength=3D"40" value=3D"search for?" size=3D"8" style=3D"height:20px;width:90px;font-size:12px;"></td> <td nowrap align=3D"right"><input type=3D"image" name=3D"submit" src=3D"/images/start_search_button.gif" width=3D"74" height=3D"36" border=3D"0"></td> </tr></table> </td><input type=3D"hidden" name=3D"document" value=3D""> </form> Software development is fundamentally hard. -- Grady Booch |
From: Vera M. <mv...@ge...> - 2004-09-01 16:52:44
|
Bruce Faulkner wrote: > And, of course, if you really wanted the HtmlAnchor objects rather than the HtmlLink objects, then it is even easier: > > List anchorList = myPage.getAnchors(); > > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > > -----Original Message----- > From: htm...@li... [mailto:htm...@li...] On Behalf Of Bruce Faulkner > Sent: Wednesday, September 01, 2004 8:23 AM > To: htm...@li... > Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? > > > Something like the following code should give what you need: > > List linkList = myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > Where myPage is an instance of an HtmlPage. > > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > -----Original Message----- > From: htm...@li... [mailto:htm...@li...] On Behalf Of Robert Baccus > Sent: Tuesday, August 31, 2004 8:13 PM > To: htm...@li... > Subject: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a page? > > > I noticed that HTMLUnit has the HtmlPage.getFirstAnchorByText(String text) method. But what I am trying to accomplish is to parse the whole page and pull out all of the HTMLLinks and put them into a list. Can this easily be done? > > Thanks. > > ===== > Rob Baccus > Email: rb...@go... > > > > __________________________________ > Do you Yahoo!? > Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_idP47&alloc_id808&op=ick > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Bruce F. <Bru...@sa...> - 2004-09-01 16:14:41
|
I have been running various versions of the nightly build (which has all= the latest changes, so it is kind of 1.3-pre2, although there hasn't be= en a separate release of 1.3-pre2 to my knowledge) for several months wi= th no real problems for the tests I run. There have been significant num= bers of fixes and enhancements to the code base since the 1.3-pre1, whic= h you can see at http://htmlunit.sourceforge.net/changes-report.html. Ho= wever, I do not know when the committers of HtmlUnit will release 1.3-pr= e2 or a "stable" version of 1.3. Bruce -- Bruce Faulkner SAS Institute Inc. -----Original Message----- From: htm...@li... [mailto:htmlunit-user-ad= mi...@li...] On Behalf Of Robert Baccus Sent: Wednesday, September 01, 2004 11:37 AM To: htm...@li... Subject: RE: [Htmlunit-user] Getting all the Anchor (HTMLLinks) on a pag= e? That is great, thanks. My problem is that I am using the 1.2.3 version and that does not seem to have this behavior. Do I have to move to the 1.3 pre-release? I am always hestitant to do t= his. The quick turn around on my issue is great, I really appreciate it. Thanks. --- Bruce Faulkner <Bru...@sa...> wrote: > In the current code for HtmlUnit (i.e. the 1.3 > pre-release code), the getAnchors() method of the > HtmlPage object does indeed return a list of HtmlAnchor objects. > > The following code snippet was used to yield the results > below: > > =09=09List anchorList =3D page.getAnchors(); > =09=09for (Iterator iter =3D anchorList.iterator(); > iter.hasNext();) > =09=09{ > =09=09=09HtmlAnchor anchor =3D (HtmlAnchor) iter.next(); > =09=09=09System.out.println("text: " + anchor.asText());=09=09=09 > =09=09=09System.out.println("href attribute: " + anchor.getHrefAttribu= te()); > =09=09} > > text: some link name > href attribute: somelink > text: some link name 1 > href attribute: somelink1 > text: some link name 2 > href attribute: somelink2 > > where the input HTML page looked like: > > <html> > <body> > <a href=3D"somelink">some link name</a> > <a href=3D"somelink1">some link name 1</a> > <a href=3D"somelink2">some link name 2</a> > </body> > </html> > > Hope this helps, > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On > Behalf Of Robert Baccus > Sent: Wednesday, September 01, 2004 10:28 AM > To: htm...@li... > Subject: RE: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > Actually looking at the code below only returns the > Anchor objects not the HtmlAnchor objects. I already > looked at this and it didn't work for me. > > I am not sure that the HtmlLink object is what I am > looking for either since I am trying to get the following <href > a=3D"somelink">some link name</a> in an object. I want to capture the= > Somelink and SomeLinkName fields and put them in a list. > > Thanks. > > > --- Bruce Faulkner <Bru...@sa...> wrote: > > > And, of course, if you really wanted the HtmlAnchor > objects rather > > than the HtmlLink objects, then it is even easier: > > > > List anchorList =3D myPage.getAnchors(); > > > > Bruce > > -- > > Bruce Faulkner > > SAS Institute Inc. > > > > -----Original Message----- > > From: htm...@li... > > [mailto:htm...@li...] On > Behalf Of Bruce > > Faulkner > > Sent: Wednesday, September 01, 2004 8:23 AM > > To: htm...@li... > > Subject: RE: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > > > > Something like the following code should give what you > need: > > > > List linkList =3D > > > myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > > Where myPage is an instance of an HtmlPage. > > > > Bruce > > -- > > Bruce Faulkner > > SAS Institute Inc. > > -----Original Message----- > > From: htm...@li... > > [mailto:htm...@li...] On > Behalf Of Robert > > Baccus > > Sent: Tuesday, August 31, 2004 8:13 PM > > To: htm...@li... > > Subject: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > > > > I noticed that HTMLUnit has the > HtmlPage.getFirstAnchorByText(String > > text) method. But what I am trying to accomplish is to > parse the > > whole page and pull out all of the HTMLLinks and put > them into a list. > > Can this easily be done? > > > > Thanks. > > > > =3D=3D=3D=3D=3D > > Rob Baccus > > Email: rb...@go... > > > > > > =09=09 > > __________________________________ > > Do you Yahoo!? > > Read only the mail you want - Yahoo! Mail SpamGuard. > > http://promotions.yahoo.com/new_mail > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java > > Enterprise J2EE developer tools! Get your free copy of BEA WebLogic > > Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick > > _______________________________________________ > > Htmlunit-user mailing list > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java > > Enterprise J2EE developer tools! Get your free copy of BEA WebLogic > > Workshop 8.1 today. > > http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dick > > _______________________________________________ > > Htmlunit-user mailing list > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java > > Enterprise J2EE developer tools! Get your free copy of BEA WebLogic > > Workshop 8.1 today. > > http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dclick > > _______________________________________________ > > Htmlunit-user mailing list > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > =3D=3D=3D=3D=3D > Rob Baccus > Email: rb...@go... > > > =09=09 > _______________________________ > Do you Yahoo!? > Express yourself with Y! Messenger! Free. Download now. > http://messenger.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id=10808&op=3Dclick > _______________________________________________ > Htmlunit-user mailing list Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > =3D=3D=3D=3D=3D Rob Baccus Email: rb...@go... =09=09 _______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotion= s.yahoo.com/goldrush ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.c= om/?ad_id=3D5047&alloc_id=3D10808&op=3Dclick _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: <al...@go...> - 2004-09-01 16:02:47
|
You should better move to Nightly Build. Pre-release has some ugly bugs, that stop the whole how. I.e.: forms are not submitted properly. Nightly Build was quite stable in January (itwas 'Current Source' at that time, but this makes no difference) and had just a few non-critical regressions and 'advanced JavaScript' problems. I hope it is still in a good condition. Regards Alexei |
From: Robert B. <rba...@ya...> - 2004-09-01 15:37:22
|
That is great, thanks. My problem is that I am using the 1.2.3 version and that does not seem to have this behavior. Do I have to move to the 1.3 pre-release? I am always hestitant to do this. The quick turn around on my issue is great, I really appreciate it. Thanks. --- Bruce Faulkner <Bru...@sa...> wrote: > In the current code for HtmlUnit (i.e. the 1.3 > pre-release code), the getAnchors() method of the > HtmlPage object does indeed return a list of HtmlAnchor > objects. > > The following code snippet was used to yield the results > below: > > List anchorList = page.getAnchors(); > for (Iterator iter = anchorList.iterator(); > iter.hasNext();) > { > HtmlAnchor anchor = (HtmlAnchor) iter.next(); > System.out.println("text: " + anchor.asText()); > System.out.println("href attribute: " + > anchor.getHrefAttribute()); > } > > text: some link name > href attribute: somelink > text: some link name 1 > href attribute: somelink1 > text: some link name 2 > href attribute: somelink2 > > where the input HTML page looked like: > > <html> > <body> > <a href="somelink">some link name</a> > <a href="somelink1">some link name 1</a> > <a href="somelink2">some link name 2</a> > </body> > </html> > > Hope this helps, > Bruce > -- > Bruce Faulkner > SAS Institute Inc. > > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On > Behalf Of Robert Baccus > Sent: Wednesday, September 01, 2004 10:28 AM > To: htm...@li... > Subject: RE: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > Actually looking at the code below only returns the > Anchor objects not the HtmlAnchor objects. I already > looked at this and it didn't work for me. > > I am not sure that the HtmlLink object is what I am > looking for either since I am trying to get the following > <href a="somelink">some link name</a> in an object. I > want to capture the Somelink and SomeLinkName fields and > put them in a list. > > Thanks. > > > --- Bruce Faulkner <Bru...@sa...> wrote: > > > And, of course, if you really wanted the HtmlAnchor > objects rather > > than the HtmlLink objects, then it is even easier: > > > > List anchorList = myPage.getAnchors(); > > > > Bruce > > -- > > Bruce Faulkner > > SAS Institute Inc. > > > > -----Original Message----- > > From: htm...@li... > > [mailto:htm...@li...] On > Behalf Of Bruce > > Faulkner > > Sent: Wednesday, September 01, 2004 8:23 AM > > To: htm...@li... > > Subject: RE: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > > > > Something like the following code should give what you > need: > > > > List linkList = > > > myPage.getDocumentElement().getHtmlElementsByTagName(HtmlLink.TAG_NAME); > > Where myPage is an instance of an HtmlPage. > > > > Bruce > > -- > > Bruce Faulkner > > SAS Institute Inc. > > -----Original Message----- > > From: htm...@li... > > [mailto:htm...@li...] On > Behalf Of Robert > > Baccus > > Sent: Tuesday, August 31, 2004 8:13 PM > > To: htm...@li... > > Subject: [Htmlunit-user] Getting all the Anchor > (HTMLLinks) on a page? > > > > > > I noticed that HTMLUnit has the > HtmlPage.getFirstAnchorByText(String > > text) method. But what I am trying to accomplish is to > parse the > > whole page and pull out all of the HTMLLinks and put > them into a list. > > Can this easily be done? > > > > Thanks. > > > > ===== > > Rob Baccus > > Email: rb...@go... > > > > > > > > __________________________________ > > Do you Yahoo!? > > Read only the mail you want - Yahoo! Mail SpamGuard. > > http://promotions.yahoo.com/new_mail > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > > _______________________________________________ > > Htmlunit-user mailing list > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_idP47&alloc_id808&op=ick > > _______________________________________________ > > Htmlunit-user mailing list > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by BEA Weblogic Workshop > > FREE Java Enterprise J2EE developer tools! > > Get your free copy of BEA WebLogic Workshop 8.1 today. > > http://ads.osdn.com/?ad_idP47&alloc_id808&op=click > > _______________________________________________ > > Htmlunit-user mailing list > Htm...@li... > > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > ===== > Rob Baccus > Email: rb...@go... > > > > _______________________________ > Do you Yahoo!? > Express yourself with Y! Messenger! Free. Download now. > http://messenger.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_idP47&alloc_id808&op=click > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > ===== Rob Baccus Email: rb...@go... _______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush |