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: Marc G. <mgu...@ya...> - 2014-05-07 15:53:38
|
Hi, be sure to use type() and not setValueQttribute or set Attribute* in order to have JS event handlers executed. Then use webClient.waitForBackgroundJavaScriptStartingBefore to give time for suggestions to come. Finally dump the DOM to the console with HtmlPage.asXml() to see if the suggestion are there or not. If yes, you should see how to retrieve them and if not, hmm, perhaps is it a problem in HtmlUnit (try with latest snapshot, simulating FF24). Cheers, Marc. -- HtmlUnit support & consulting from the source Blog: http://mguillem.wordpress.com Le 26/04/2014 19:55, אברהם חיון a écrit : > Hi, > > > > I want to scrape the Ajax suggestions of google (or other sites). > > > Can anyone give me a hand on how to address it? > > What I already tried? > I used HtmlUnit to objectify the page then add to the search box the > word I need suggestions for. > > It works well, and when I download the current page using page.asText(), > I do get the page with my word in the search field, but I don't get the > Ajax suggestions which I can see on the screen but can't grab using > HtmlUnit. > > > > > Any tip on how to do it? > |
From: asashour <asa...@ya...> - 2014-05-03 23:40:23
|
Hello, - You must subscribe to the list before posting. - The method is now supported for Chrome in SVN version. You can change your code to use Firefox or IE11. If you need Chrome support, then get latest snapshot, or wait for HtmlUnit 2.15 which should be released soon. Ahmed Can Oncel wrote > Hi everyone, > > I tried to get data from a website which is named as vatanbilgisayar.com. > I could not get the data by using any HTTP queries or getting HTML codes, > because the data I need is not placed in source code, so my aim is to get > the data by using HTML Unit. > > So, for this I use the code below, after the code, there is error logs. I > will be very thankful, if anyone can help me to solve this problem. > > Best Regards, > Can Öncel > > -----CODE START------ > > import java.util.List; > > import com.gargoylesoftware.htmlunit.BrowserVersion; > import com.gargoylesoftware.htmlunit.WebClient; > import com.gargoylesoftware.htmlunit.html.FrameWindow; > import com.gargoylesoftware.htmlunit.html.HtmlAnchor; > import com.gargoylesoftware.htmlunit.html.HtmlPage; > > > public class HTMLUnitTest { > > /** > * @param args > * @throws Exception > */ > public static void main(String[] args) throws Exception { > // TODO Auto-generated method stub > find(); > } > > > private static void find() throws Exception { > > java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(java.util.logging.Level.OFF); > > HtmlPage nextPage; > String url = > "http://www.vatanbilgisayar.com/hp-14-n201st-core-i5-4200u-16ghz-4gb-500gb-14-2gb-w81-notebook.html"; > > WebClient webclient = new WebClient(BrowserVersion.CHROME); > webclient.getOptions().setUseInsecureSSL(true); > HtmlPage page = webclient.getPage(url); > > List > <HtmlAnchor> > links = (List > <HtmlAnchor> > ) page.getByXPath("//td[@class='gridUrunOzellikDetayIcerik']"); > > for(int x=0; x<links.size(); x++) { > System.out.println(links.get(x).asText()); > } > } > > } > > -----CODE FINISH----- > > > Exception in thread "main" ======= EXCEPTION START ======== > EcmaError: lineNumber=[2] column=[0] lineSource=[<no source>] > name=[TypeError] > sourceName=[http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js] > message=[TypeError: Cannot find function getPropertyValue in object > [object ComputedCSSStyleDeclaration]. > (http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js#2)] > com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find > function getPropertyValue in object [object ComputedCSSStyleDeclaration]. > (http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js#2) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:689) > at > net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1074) > at > com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) > at > com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) > at > com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) > at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) > at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) > at > org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) > at > org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) > at > org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) > at > org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) > at > org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) > at > org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) > at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) > at > com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) > at > com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) > at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) > at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > at HTMLUnitTest.find(HTMLUnitTest.java:30) > at HTMLUnitTest.main(HTMLUnitTest.java:18) > Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: > TypeError: Cannot find function getPropertyValue in object [object > ComputedCSSStyleDeclaration]. > (http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js#2) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3613) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3634) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3650) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3714) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2233) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2215) > at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1333) > at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) > at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) > at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) > at > com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057) > at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) > ... 31 more > Enclosed exception: > net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot > find function getPropertyValue in object [object > ComputedCSSStyleDeclaration]. > (http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js#2) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3629) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3613) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3634) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3650) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3714) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2233) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2215) > at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1333) > at script(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script.en(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script(http://www.vatanbilgisayar.com/Scripts/jquery-base.min.js:2) > at script(http://www.vatanbilgisayar.com/upload/js/jquery-ui.js:174) > at script(http://www.vatanbilgisayar.com/upload/js/jquery-ui.js:5) > at > net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:798) > at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:105) > at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:411) > at > com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:309) > at > net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3057) > at > net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:115) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:566) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:674) > at > net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:620) > at > net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:513) > at > com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:575) > at > com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:1074) > at > com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:391) > at > com.gargoylesoftware.htmlunit.html.HtmlScript$3.execute(HtmlScript.java:272) > at > com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:286) > at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:702) > at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) > at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:662) > at > org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1170) > at > org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1072) > at > org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206) > at > org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:330) > at > org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3126) > at > org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2093) > at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:920) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) > at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at > com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:926) > at > com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:245) > at > com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:191) > at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:268) > at > com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:156) > at > com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:455) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:329) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:394) > at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:379) > at HTMLUnitTest.find(HTMLUnitTest.java:30) > at HTMLUnitTest.main(HTMLUnitTest.java:18) > ======= EXCEPTION END ======== -- View this message in context: http://htmlunit.10904.n7.nabble.com/Problem-with-getPage-function-tp33725p33745.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Alain B. <alb...@gm...> - 2014-05-03 10:47:06
|
I don't have too much experience with it But I will try something like that: WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24); HtmlPage page = webClient.getPage("http://yourpage.com"); HtmlDivision div = page.getHtmlElementById("introductionDate"); String content = div.getTextContent(); Regards Alain 2014-05-03 1:59 GMT+02:00 Rich Goldman <ri...@um...>: > Hi. I'm new to HtmlUnit and am hoping this is an easy newbie question. > > I'm trying to parse out information about legislation from the DC City > Council website. They recently changed their system from a basic HTML page > of data to a dynamically loaded page. > > An example bill page is: > http://lims.dccouncil.us/Legislation/PR20-0624 > > When I retrieve the Page, I get the html, but without the fields > populated. > > I've tried without success to identify a javascript function to call via > HtmlUnit that would populate the html. > > What might I be missing in order to get a Page object that has the html > with populated fields? > > For example, in the provided link, the html has the string/row header > "Introduction Date" hard-coded, but I need to get the populated value > of Jan 22, 2014. > > Any advise, code, or reading material would be greatly appreciated. > > Thank you. > -Rich > > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Rich G. <ri...@um...> - 2014-05-03 00:25:34
|
Hi. I'm new to HtmlUnit and am hoping this is an easy newbie question. I'm trying to parse out information about legislation from the DC City Council website. They recently changed their system from a basic HTML page of data to a dynamically loaded page. An example bill page is: http://lims.dccouncil.us/Legislation/PR20-0624 When I retrieve the Page, I get the html, but without the fields populated. I've tried without success to identify a javascript function to call via HtmlUnit that would populate the html. What might I be missing in order to get a Page object that has the html with populated fields? For example, in the provided link, the html has the string/row header "Introduction Date" hard-coded, but I need to get the populated value of Jan 22, 2014. Any advise, code, or reading material would be greatly appreciated. Thank you. -Rich |
From: David M. G. <mic...@gm...> - 2014-04-30 11:02:24
|
Hi, I opened defect #1598 for it. Thanks, David On Wed, Apr 30, 2014 at 9:46 AM, David Michael Gang <mic...@gm...>wrote: > Hi, > > I am already using the functions to wait for the javascript. > > I used both > waitForBackgroundJavaScript(10000); > > and > waitForBackgroundJavaScriptStartingBefore(10000) > > and it did not help. > > > Besides this I need a generic solution, which can be achieved. > > For example jsoup knows how to cope with this html > > package test; > > import java.io.File; > > import java.io.IOException; > > import org.jsoup.nodes.Document; > import org.jsoup.nodes.Element; > import org.jsoup.select.Elements; > import org.jsoup.Jsoup; > public class JsoupTest1 { > > public static void main(String[] args) throws IOException { > > File in = new File("l.html"); > Document doc = Jsoup.parse(in, null); > Elements elems = doc.select("table"); > > for (Element elem:elems) { > System.out.println(elem.text()); > } > > > } > > } > > Maybe i should file a bug, but i don't think that there is a reason for executing the special javascript command. > > Thanks, > > David > > > > >In the source page i could see body tag appended with: > > >onload="hideDiv(true);initBoxes('listview');callSubScroll('frm_tagged_documents',0,1);updateResultsNav();reloadClassification('false');scrollToHitPos('false');" > >onUnload="storeScrollToHitPos('false'); > > >Execute this js functions then try extracting the page. > > >Once more thing what is your desired output > > |
From: David M. G. <mic...@gm...> - 2014-04-30 06:46:46
|
Hi, I am already using the functions to wait for the javascript. I used both waitForBackgroundJavaScript(10000); and waitForBackgroundJavaScriptStartingBefore(10000) and it did not help. Besides this I need a generic solution, which can be achieved. For example jsoup knows how to cope with this html package test; import java.io.File; import java.io.IOException; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.jsoup.Jsoup; public class JsoupTest1 { public static void main(String[] args) throws IOException { File in = new File("l.html"); Document doc = Jsoup.parse(in, null); Elements elems = doc.select("table"); for (Element elem:elems) { System.out.println(elem.text()); } } } Maybe i should file a bug, but i don't think that there is a reason for executing the special javascript command. Thanks, David >In the source page i could see body tag appended with: >onload="hideDiv(true);initBoxes('listview');callSubScroll('frm_tagged_documents',0,1);updateResultsNav();reloadClassification('false');scrollToHitPos('false');" >onUnload="storeScrollToHitPos('false'); >Execute this js functions then try extracting the page. >Once more thing what is your desired output |
From: chris d. <ach...@gm...> - 2014-04-29 14:49:33
|
In the source page i could see body tag appended with: onload="hideDiv(true);initBoxes('listview');callSubScroll('frm_tagged_documents',0,1);updateResultsNav();reloadClassification('false');scrollToHitPos('false');" onUnload="storeScrollToHitPos('false'); Execute this js functions then try extracting the page. Once more thing what is your desired output On Tue, Apr 29, 2014 at 7:21 PM, David Michael Gang <mic...@gm...> wrote: > Hi, > > Here is the page attached. > > BR, > David > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > -- " What we sow we will reap." |
From: chris d. <ach...@gm...> - 2014-04-29 12:36:45
|
Save the page in HTML and attach it. which help in finding the tags and other detail easier On Tue, Apr 29, 2014 at 5:51 PM, David Michael Gang <mic...@gm...>wrote: > Hi, > > I agree and normally i give an exact example with a program and the url, > but this is a private url. > > Thanks, > David > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > -- *" What we sow we will reap."* |
From: David M. G. <mic...@gm...> - 2014-04-29 12:33:50
|
Hi, When looking on the function which creates the row iterator: private void setNextRow(final DomNode node) { nextRow_ = null; for (DomNode next = node; next != null; next = next.getNextSibling()) { if (next instanceof HtmlTableRow) { nextRow_ = (HtmlTableRow) next; return; } else if (currentGroup_ == null && next instanceof TableRowGroup) { currentGroup_ = (TableRowGroup) next; setNextRow(next.getFirstChild()); return; } } if (currentGroup_ != null) { final DomNode group = currentGroup_; currentGroup_ = null; setNextRow(group.getNextSibling()); } } public Iterator<HtmlTableRow> iterator() { return this; } } As we see it just descends into the lower tags, if next is an instance of a TableRowGroup, like tbody, but not if there is a custom tag. I don't know if it is a root cause because maybe the html parser should ignore these tags. When inspecting the element with firefox i see that he does it (inspect element). BR, David On Tue, Apr 29, 2014 at 2:50 PM, David Michael Gang <mic...@gm...>wrote: > Hi all, > > I crawled a page and the HtmlPage.asText function did not return the > desired result: > I tracked it down that somehow that the table rows were ignored. > The reason is that in the crawled page the table trs were wrapped into a > doc tag. > > <table width="100%" border="0" cellspacing="0" cellpadding="0"> > <tbody> > <tr class="nopadding"> > <td> > <a name="DOCNO_1"> > </a> > </td> > </tr> > <doc> > <tr valign="baseline" height="8" class="toprow"> > <th width="6%" align="left" valign="center" > nowrap="nowrap"> > <span> > <input type="checkbox" id="frm_control_box" > title="Click here to select or de-select all" name="frm_control_box" > value="checkbox" onclick="javascript:subSetAllSelectionStatus()"/> > </span> > </th> > <th width="94%" align="left" valign="center" > nowrap="nowrap"> > <span> > Results > </span> > </th> > </tr> > <tr class="noshaderow1st" style="padding-bottom: > 8px;" height="8" valign="baseline"> > <td width="6%" align="left" nowrap="nowrap" > valign="top"> > <input onclick="javascript:manageBox('1')" > type="checkbox" value="1" name="frm_tagged_documents" title="Click here to > deliver or to view tagged documents" id="frm_tagged_documents1"/> > <label style="{cursor: pointer; cursor: hand;}" > for="frm_tagged_documents1"> > 1. > </label> > </td> > <td width="94%" align="left" valign="top"> > <a href="aaa" target="_parent"> > aaa > </a> > <br class="br"/> > <span class="notranslate"> > bbb > </span> > , November 19, 2011, Pg. 7, 758 words > </td> > </tr> > </doc> > <tr class="nopadding"> > <td> > <a name="DOCNO_2"> > </a> > </td> > </tr> > <doc> > <tr class="shaderow1st" style="padding-bottom: 8px;" > height="8" valign="baseline"> > <td width="6%" align="left" nowrap="nowrap" > valign="top"> > <input onclick="javascript:manageBox('2')" > type="checkbox" value="2" name="frm_tagged_documents" title="Click here to > deliver or to view tagged documents" id="frm_tagged_documents2"/> > <label style="{cursor: pointer; cursor: hand;}" > for="frm_tagged_documents2"> > 2. > </label> > </td> > <td width="94%" align="left" valign="top"> > <a href="ccc" target="_parent"> > ddd > </a> > <br class="br"/> > <span class="notranslate"> > eee > </span> > , November 19, 2011, Pg. 18, 1216 words, MICHAEL > HENDERSON > </td> > </tr> > </doc> > > </tbody> > In firefox the page is displayed nice. > Is it somehow possible to tell htmlunit to ignore the doc tag and recurse > into it to find the tr tag? > > > Thanks, > David > |
From: David M. G. <mic...@gm...> - 2014-04-29 12:22:03
|
Hi, I agree and normally i give an exact example with a program and the url, but this is a private url. Thanks, David |
From: chris d. <ach...@gm...> - 2014-04-29 12:07:48
|
If you could share the URL its easy to view content in the browser On Tue, Apr 29, 2014 at 5:20 PM, David Michael Gang <mic...@gm...>wrote: > Hi all, > > I crawled a page and the HtmlPage.asText function did not return the > desired result: > I tracked it down that somehow that the table rows were ignored. > The reason is that in the crawled page the table trs were wrapped into a > doc tag. > > <table width="100%" border="0" cellspacing="0" cellpadding="0"> > <tbody> > <tr class="nopadding"> > <td> > <a name="DOCNO_1"> > </a> > </td> > </tr> > <doc> > <tr valign="baseline" height="8" class="toprow"> > <th width="6%" align="left" valign="center" > nowrap="nowrap"> > <span> > <input type="checkbox" id="frm_control_box" > title="Click here to select or de-select all" name="frm_control_box" > value="checkbox" onclick="javascript:subSetAllSelectionStatus()"/> > </span> > </th> > <th width="94%" align="left" valign="center" > nowrap="nowrap"> > <span> > Results > </span> > </th> > </tr> > <tr class="noshaderow1st" style="padding-bottom: > 8px;" height="8" valign="baseline"> > <td width="6%" align="left" nowrap="nowrap" > valign="top"> > <input onclick="javascript:manageBox('1')" > type="checkbox" value="1" name="frm_tagged_documents" title="Click here to > deliver or to view tagged documents" id="frm_tagged_documents1"/> > <label style="{cursor: pointer; cursor: hand;}" > for="frm_tagged_documents1"> > 1. > </label> > </td> > <td width="94%" align="left" valign="top"> > <a href="aaa" target="_parent"> > aaa > </a> > <br class="br"/> > <span class="notranslate"> > bbb > </span> > , November 19, 2011, Pg. 7, 758 words > </td> > </tr> > </doc> > <tr class="nopadding"> > <td> > <a name="DOCNO_2"> > </a> > </td> > </tr> > <doc> > <tr class="shaderow1st" style="padding-bottom: 8px;" > height="8" valign="baseline"> > <td width="6%" align="left" nowrap="nowrap" > valign="top"> > <input onclick="javascript:manageBox('2')" > type="checkbox" value="2" name="frm_tagged_documents" title="Click here to > deliver or to view tagged documents" id="frm_tagged_documents2"/> > <label style="{cursor: pointer; cursor: hand;}" > for="frm_tagged_documents2"> > 2. > </label> > </td> > <td width="94%" align="left" valign="top"> > <a href="ccc" target="_parent"> > ddd > </a> > <br class="br"/> > <span class="notranslate"> > eee > </span> > , November 19, 2011, Pg. 18, 1216 words, MICHAEL > HENDERSON > </td> > </tr> > </doc> > > </tbody> > In firefox the page is displayed nice. > Is it somehow possible to tell htmlunit to ignore the doc tag and recurse > into it to find the tr tag? > > > Thanks, > David > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > -- *" What we sow we will reap."* |
From: chris d. <ach...@gm...> - 2014-04-29 12:06:23
|
Check the body tag whether any onload js functions present in it. If so execute the functions before getting elements On Tue, Apr 29, 2014 at 5:23 PM, David Michael Gang <mic...@gm...>wrote: > Hi Valentin, > > This is a real coincidence. > I have the same problem with a different tag. > > BR, > David > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > -- *" What we sow we will reap."* |
From: David M. G. <mic...@gm...> - 2014-04-29 11:54:01
|
Hi Valentin, This is a real coincidence. I have the same problem with a different tag. BR, David |
From: David M. G. <mic...@gm...> - 2014-04-29 11:50:11
|
Hi all, I crawled a page and the HtmlPage.asText function did not return the desired result: I tracked it down that somehow that the table rows were ignored. The reason is that in the crawled page the table trs were wrapped into a doc tag. <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr class="nopadding"> <td> <a name="DOCNO_1"> </a> </td> </tr> <doc> <tr valign="baseline" height="8" class="toprow"> <th width="6%" align="left" valign="center" nowrap="nowrap"> <span> <input type="checkbox" id="frm_control_box" title="Click here to select or de-select all" name="frm_control_box" value="checkbox" onclick="javascript:subSetAllSelectionStatus()"/> </span> </th> <th width="94%" align="left" valign="center" nowrap="nowrap"> <span> Results </span> </th> </tr> <tr class="noshaderow1st" style="padding-bottom: 8px;" height="8" valign="baseline"> <td width="6%" align="left" nowrap="nowrap" valign="top"> <input onclick="javascript:manageBox('1')" type="checkbox" value="1" name="frm_tagged_documents" title="Click here to deliver or to view tagged documents" id="frm_tagged_documents1"/> <label style="{cursor: pointer; cursor: hand;}" for="frm_tagged_documents1"> 1. </label> </td> <td width="94%" align="left" valign="top"> <a href="aaa" target="_parent"> aaa </a> <br class="br"/> <span class="notranslate"> bbb </span> , November 19, 2011, Pg. 7, 758 words </td> </tr> </doc> <tr class="nopadding"> <td> <a name="DOCNO_2"> </a> </td> </tr> <doc> <tr class="shaderow1st" style="padding-bottom: 8px;" height="8" valign="baseline"> <td width="6%" align="left" nowrap="nowrap" valign="top"> <input onclick="javascript:manageBox('2')" type="checkbox" value="2" name="frm_tagged_documents" title="Click here to deliver or to view tagged documents" id="frm_tagged_documents2"/> <label style="{cursor: pointer; cursor: hand;}" for="frm_tagged_documents2"> 2. </label> </td> <td width="94%" align="left" valign="top"> <a href="ccc" target="_parent"> ddd </a> <br class="br"/> <span class="notranslate"> eee </span> , November 19, 2011, Pg. 18, 1216 words, MICHAEL HENDERSON </td> </tr> </doc> </tbody> In firefox the page is displayed nice. Is it somehow possible to tell htmlunit to ignore the doc tag and recurse into it to find the tr tag? Thanks, David |
From: chris d. <ach...@gm...> - 2014-04-28 07:52:37
|
Check whether any javascript functions are involved to generate . If so execute the js if (webdriver instanceof JavascriptExecutor) { ((JavascriptExecutor) webdriver).executeScript("init();TabInit();Accordinit();"); } On Mon, Apr 28, 2014 at 1:07 PM, Valentin Popa <v.v...@gm...>wrote: > Hello > > I want to get visible text from this page: > http://zeitarbeit-online-datenbank.de/index.php?art_id=53466&load=10,1,1&search=such_taetigkeit|;such_kategorie|;sort_order|erstellt_am;sort_dir|desc;such_erst|;such_zeitraum|;such_bl|;such_ort|;such_plz|;such_term|;nmbr|4;ap|0 > > For this I use the bellow simple code: > > final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_17); > HtmlPage page = webClient.getPage(" > http://zeitarbeit-online-datenbank.de/index.php?art_id=53466&load=10,1,1&search=such_taetigkeit|;such_kategorie|;sort_order|erstellt_am;sort_dir|desc;such_erst|;such_zeitraum|;such_bl|;such_ort|;such_plz|;such_term|;nmbr|4;ap|0 > "); > System.out.println(page.asText()); > > The output is not what it should be. > > Looking in html I can see this: > > <table cellpadding="0" cellspacing="0" align="right" border="0"> <form name="suchformular" method="get" action="index.php"></form> <input name="load" value="7" type="hidden"> <input name="sid" value="c23371c7273e7a23add375c01fe35183" type="hidden"> <input name="abgesendet" value="yes" type="hidden"> > <tbody><tr> > <td align="right" height="32" valign="bottom"> > > > As you can see <tr> is in form instead to be after <table> but in browser this is working. Looking in HtmlSerializer class from htmlunit I can see that for tables is a special method like this: > > else if (node instanceof HtmlTable) { > appendHtmlTable((HtmlTable) node); > } > > private void appendHtmlTable(final HtmlTable htmlTable) { > doAppendBlockSeparator(); > final String caption = htmlTable.getCaptionText(); > if (caption != null) { > doAppend(caption); > doAppendBlockSeparator(); > } > > boolean first = true; > > // first thead has to be displayed first and first tfoot has to be displayed last > final HtmlTableHeader tableHeader = htmlTable.getHeader(); > if (tableHeader != null) { > first = appendHtmlTableRows(tableHeader.getRows(), true, null, null); > } > final HtmlTableFooter tableFooter = htmlTable.getFooter(); > > first = appendHtmlTableRows(htmlTable.getRows(), first, tableHeader, tableFooter); > > if (tableFooter != null) { > first = appendHtmlTableRows(tableFooter.getRows(), first, null, null); > } > > doAppendBlockSeparator(); > } > > When this: htmlTable.getRows() is called it is not able to return the rows because the rows are in form. > > Any idea how to fix this? Or do you know why htmlunit use speial routine to print tables? > > Best Regards > > Valentin > > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > -- *" What we sow we will reap."* |
From: Valentin P. <v.v...@gm...> - 2014-04-28 07:37:51
|
Hello I want to get visible text from this page: http://zeitarbeit-online-datenbank.de/index.php?art_id=53466&load=10,1,1&search=such_taetigkeit|;such_kategorie|;sort_order|erstellt_am;sort_dir|desc;such_erst|;such_zeitraum|;such_bl|;such_ort|;such_plz|;such_term|;nmbr|4;ap|0 For this I use the bellow simple code: final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_17); HtmlPage page = webClient.getPage(" http://zeitarbeit-online-datenbank.de/index.php?art_id=53466&load=10,1,1&search=such_taetigkeit|;such_kategorie|;sort_order|erstellt_am;sort_dir|desc;such_erst|;such_zeitraum|;such_bl|;such_ort|;such_plz|;such_term|;nmbr|4;ap|0 "); System.out.println(page.asText()); The output is not what it should be. Looking in html I can see this: <table cellpadding="0" cellspacing="0" align="right" border="0"> <form name="suchformular" method="get" action="index.php"></form> <input name="load" value="7" type="hidden"> <input name="sid" value="c23371c7273e7a23add375c01fe35183" type="hidden"> <input name="abgesendet" value="yes" type="hidden"> <tbody><tr> <td align="right" height="32" valign="bottom"> As you can see <tr> is in form instead to be after <table> but in browser this is working. Looking in HtmlSerializer class from htmlunit I can see that for tables is a special method like this: else if (node instanceof HtmlTable) { appendHtmlTable((HtmlTable) node); } private void appendHtmlTable(final HtmlTable htmlTable) { doAppendBlockSeparator(); final String caption = htmlTable.getCaptionText(); if (caption != null) { doAppend(caption); doAppendBlockSeparator(); } boolean first = true; // first thead has to be displayed first and first tfoot has to be displayed last final HtmlTableHeader tableHeader = htmlTable.getHeader(); if (tableHeader != null) { first = appendHtmlTableRows(tableHeader.getRows(), true, null, null); } final HtmlTableFooter tableFooter = htmlTable.getFooter(); first = appendHtmlTableRows(htmlTable.getRows(), first, tableHeader, tableFooter); if (tableFooter != null) { first = appendHtmlTableRows(tableFooter.getRows(), first, null, null); } doAppendBlockSeparator(); } When this: htmlTable.getRows() is called it is not able to return the rows because the rows are in form. Any idea how to fix this? Or do you know why htmlunit use speial routine to print tables? Best Regards Valentin |
From: UliScherrer <uli...@gm...> - 2014-04-17 14:36:18
|
Hi Ronald, thanks for Help. I had success. I just took an anchor (does not matter which one) and changed href to setAttribute("href", "https://......../showpdf.do?requestor=Shipper&filetype=pdf"); WebResponse was now a pdf file. Uli UliScherrer wrote > Hi Ronald, > > yes, there is no form. > Live HTTP headers (Firefox add on) shows me after the click following url: > https://......../showpdf.do?requestor=Shipper&filetype=pdf > > I suppose, the following window reads a cookie to get the information > which pdf is shown. > > I tried page.getWebClient().getPage(url_as_shown_above); but without the > desired result. > Is there another way to execute this url in my pagecontext? > Or should I dig into javascript and deal with ScriptableObject? > I am not experienced enough to see the right way. > > thanks > Uli -- View this message in context: http://htmlunit.10904.n7.nabble.com/Does-not-get-file-when-InputButton-clicked-tp33583p33601.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: UliScherrer <uli...@gm...> - 2014-04-17 08:08:25
|
Hi Ronald, yes, there is no form. Live HTTP headers (Firefox add on) shows me after the click following url: https://......../showpdf.do?requestor=Shipper&filetype=pdf I suppose, the following window reads a cookie to get the information which pdf is shown. I tried page.getWebClient().getPage(url_as_shown_above); but without the desired result. Is there another way to execute this url in my pagecontext? Or should I dig into javascript and deal with ScriptableObject? I am not experienced enough to see the right way. thanks Uli -- View this message in context: http://htmlunit.10904.n7.nabble.com/Does-not-get-file-when-InputButton-clicked-tp33583p33594.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: Ronald B. <rb...@rb...> - 2014-04-15 20:00:26
|
Hi Uli, i can only guess. I see no form and the button you press is of type button (not submit) that usually only triggers javascript code. There is a good chance, that this js code at least opens a new window and does some more magic like Ajax. So you first have to understand what is really going on when clicking the button. With this info we can check what the reason for your problem migth be. RBRi On Tue, 15 Apr 2014 04:52:12 -0700 (PDT) UliScherrer wrote: > >Hi, >when I click in a GUI Browser on InputButton (Submit) another Windows opens >and shows a Pdf. > ><div id="viewAndDownloadIntlInvoiceDialogLiteCsv" >class="dialogWithTitleAndButtons"> > <div class="dialogTitle" > > View/Download Invoice Data > </div> > <div class="dialogContent"> > <p>Please select a file format to view/download your invoice.</p> > <input type="radio" name="format" value="pdf" checked="checked"/>PDF > <input type="radio" name="format" value="csv" />UPS Billing Data (.csv >format, 250 data elements) > </div> > <div class="dialogButtons"> > <input type="button" >id="viewAndDownloadIntlInvoiceDialogLiteCsvCancelBtn" class="bSwan" >value="Cancel"/> > <input type="button" >id="viewAndDownloadIntlInvoiceDialogLiteCsvSubmitBtn" class="bSwan" >value="Submit"/> > </div> ></div> > > > >In HtmlUnit (2.14) I dont get the Pdf. >HtmlButtonInput submit = >myPage.getHtmlElementById("viewAndDownloadIntlInvoiceDialogLiteCsvSubmitBtn"); >Page rslt = submit.click(); >WebResponse response = rslt.getWebResponse(); > >response shows the loaded html-page. > >What is going wrong? > >Cheers >Uli > > > > >-- >View this message in context: http://htmlunit.10904.n7.nabble.com/Does-not-get-file-when-InputButton-clicked-tp33583.html >Sent from the HtmlUnit - General mailing list archive at Nabble.com. > >------------------------------------------------------------------------------ >Learn Graph Databases - Download FREE O'Reilly Book >"Graph Databases" is the definitive new guide to graph databases and their >applications. Written by three acclaimed leaders in the field, >this first edition is now available. Download your free book today! >http://p.sf.net/sfu/NeoTech >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: UliScherrer <uli...@gm...> - 2014-04-15 11:52:21
|
Hi, when I click in a GUI Browser on InputButton (Submit) another Windows opens and shows a Pdf. <div id="viewAndDownloadIntlInvoiceDialogLiteCsv" class="dialogWithTitleAndButtons"> <div class="dialogTitle" > View/Download Invoice Data </div> <div class="dialogContent"> <p>Please select a file format to view/download your invoice.</p> <input type="radio" name="format" value="pdf" checked="checked"/>PDF <input type="radio" name="format" value="csv" />UPS Billing Data (.csv format, 250 data elements) </div> <div class="dialogButtons"> <input type="button" id="viewAndDownloadIntlInvoiceDialogLiteCsvCancelBtn" class="bSwan" value="Cancel"/> <input type="button" id="viewAndDownloadIntlInvoiceDialogLiteCsvSubmitBtn" class="bSwan" value="Submit"/> </div> </div> In HtmlUnit (2.14) I dont get the Pdf. HtmlButtonInput submit = myPage.getHtmlElementById("viewAndDownloadIntlInvoiceDialogLiteCsvSubmitBtn"); Page rslt = submit.click(); WebResponse response = rslt.getWebResponse(); response shows the loaded html-page. What is going wrong? Cheers Uli -- View this message in context: http://htmlunit.10904.n7.nabble.com/Does-not-get-file-when-InputButton-clicked-tp33583.html Sent from the HtmlUnit - General mailing list archive at Nabble.com. |
From: David M. G. <mic...@gm...> - 2014-04-09 13:52:51
|
Hi, The problem looks to be solved. Thanks, David |
From: Ronald B. <rb...@rb...> - 2014-04-06 06:38:36
|
Fixed in SVN, please try with the latest build. RBRi On Fri, 28 Mar 2014 11:19:38 +0100 Marc Guillemot wrote: > >Hi, > >can you provide a minimal Html + Js code allowing to reproduce the >problem and open an issue with it? > >Cheers, >Marc. |
From: Amer Al-A. <ame...@ya...> - 2014-04-01 02:58:00
|
Here's a simple code <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Test</title> <script> function insertMyRow(){ var mytable = document.getElementById("MyTable"); var row = mytable.insertRow(1); var cell = row.insertCell(0); cell.innerHTML = "<h2>New SecondRow :) </h2>"; } </script> </head> <body> <table id="MyTable"> <tr><td><h3>First Row</h3></td></tr> <tr><td><h3>Second Row</h3></td></tr> </table> <a href="javascript:void(insertMyRow())" id="AddRowLink">Add new Second Row</a> </body> </html> final HtmlPage enclosedPage = (HtmlPage) webClient.getCurrentWindow().getEnclosedPage(); final DomElement elementById = enclosedPage.getElementById("MyTable"); System.out.println("Before insert"); System.out.println(elementById.asXml()); final HtmlElement link = (HtmlElement) enclosedPage.getElementById("AddRowLink"); link.click(); System.out.println("\nAfter insert"); System.out.println(elementById.asXml()); Before insert <table id="MyTable"> <tbody> <tr> <td> <h3> First Row </h3> </td> </tr> <tr> <td> <h3> Second Row </h3> </td> </tr> </tbody> </table> After insert <table id="MyTable"> <tbody> <tr> <td> <h3> First Row </h3> </td> </tr> <tr> <td> <h3> Second Row </h3> </td> </tr> <tr> <td> <h2> New SecondRow :) </h2> </td> </tr> </tbody> </table> Sent from Yahoo Mail on Android |
From: Marc G. <mgu...@ya...> - 2014-03-28 10:19:47
|
Hi, can you provide a minimal Html + Js code allowing to reproduce the problem and open an issue with it? Cheers, Marc. -- HtmlUnit support & consulting from the source Blog: http://mguillem.wordpress.com On 26/03/2014 04:49, Amer Al-Amayreh wrote: > Hello > I have found that RowContainer.insertRow(int) doesn't allow insert row > before the last row > The problem is in this line: > > if(index >= rowCount - 1) { > > I think the -1 should be removed. > > http://sourceforge.net/p/htmlunit/code/HEAD/tree/tags/HtmlUnit-2.14/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/RowContainer.java#l150 > > Thanks > |
From: Marc G. <mgu...@ya...> - 2014-03-28 09:57:32
|
Hi, can you investigate on the type of the requests and where they come from? HtmlUnit doesn't load pictures when it is not needed. Cheers, Marc. -- HtmlUnit support & consulting from the source Blog: http://mguillem.wordpress.com On 28/03/2014 06:01, Sreenath wrote: > Hello, > > I have done some navigation with both htmlunit and real browser, > compared request invocations in both cases, found few request > invocations are missing htmlunit navigation. Please advice on this. > > Thanks > Sreenadh |