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: nonSonoPaola <non...@gm...> - 2016-07-28 07:22:22
|
Hi, the item was not correct. It works, now! Thanks for your help, Laura 2016-07-27 18:29 GMT+02:00 ricky biswas <ric...@gm...>: > Hi, > > Could you check that the current remort-item (on which you are calling > getFirstByXpath) that you are getting is right, If yes then could you share > snippet of code so I can ? > > Thanks, > Debmalya > > On Wed, 27 Jul 2016 at 21:46 nonSonoPaola <non...@gm...> wrote: > >> Hi, >> I tried with the ".//div[contains(@class, 'item-chart')]" query, with >> the same result :( >> >> Thanks, >> Laura >> >> 2016-07-27 17:56 GMT+02:00 ricky biswas <ric...@gm...>: >> >>> Hello Laura, >>> >>> If you do getFirstByXpath(".//div[contains(@class, 'item-chart')]") on >>> report-item node then you will get the first div of under the report-item >>> node. >>> >>> When you try to find the node by using '//', this will always try to >>> find the node from the root html element, and when you try to find the >>> xPath using './/' then it will search from the current node (in your case >>> report-item). >>> >>> Thanks, >>> Deb >>> >>> On Wed, 27 Jul 2016 at 20:11 nonSonoPaola <non...@gm...> >>> wrote: >>> >>>> Hi, >>>> I'm parsing an html like the attached one. >>>> >>>> I need to iterate on report items and, for each item, retrieve item-chart >>>> and item-table nodes. >>>> >>>> If I perform getFirstByXPath or getByXPath methods (on a report-item >>>> node) with the following xPath query: >>>> >>>> //div[contains(@class, 'item-chart')] >>>> >>>> I always get the first matching element in the html document instead >>>> the first beginning from the current report item. >>>> >>>> >>>> Can any one explain me what is wrong with my test case? >>>> >>>> >>>> Thanks, >>>> >>>> Laura >>>> >>>> ------------------------------------------------------------------------------ >>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and >>>> traffic >>>> patterns at an interface-level. Reveals which users, apps, and >>>> protocols are >>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >>>> J-Flow, sFlow and other flows. Make informed decisions using capacity >>>> planning >>>> reports.http://sdm.link/zohodev2dev >>>> _______________________________________________ >>>> Htmlunit-user mailing list >>>> Htm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> What NetFlow Analyzer can do for you? Monitors network bandwidth and >>> traffic >>> patterns at an interface-level. Reveals which users, apps, and protocols >>> are >>> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >>> J-Flow, sFlow and other flows. Make informed decisions using capacity >>> planning >>> reports.http://sdm.link/zohodev2dev >>> _______________________________________________ >>> Htmlunit-user mailing list >>> Htm...@li... >>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>> >>> >> >> ------------------------------------------------------------------------------ >> What NetFlow Analyzer can do for you? Monitors network bandwidth and >> traffic >> patterns at an interface-level. Reveals which users, apps, and protocols >> are >> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >> J-Flow, sFlow and other flows. Make informed decisions using capacity >> planning >> reports.http://sdm.link/zohodev2dev >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Peter R. <p....@gm...> - 2016-07-28 07:00:21
|
Collegues, I often have IAE exceptions like this: Exception in thread "HtmlUnit Managed Thread #83 for WebWindow : XMLHttpRequest.send" java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java:857) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at com.gargoylesoftware.htmlunit.javascript.regexp.HtmlUnitRegExpProxy.action(HtmlUnitRegExpProxy.java:75) at org.mozilla.javascript.NativeString.execIdCall(NativeString.java:380) at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398) at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472) at com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.setState(XMLHttpRequest.java:142) at com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.doSend(XMLHttpRequest.java:413) at com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.access$000(XMLHttpRequest.java:54) at com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest$1.run(XMLHttpRequest.java:361) at org.mozilla.javascript.Context.call(Context.java:515) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507) at com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest$2.run(XMLHttpRequest.java:367) at java.lang.Thread.run(Thread.java:745) at com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManager.java:116) Any idea? Regards |
From: Ronald B. <rb...@rb...> - 2016-07-27 20:38:28
|
Thanks Ahmed for doing it On Wed, 27 Jul 2016 13:51:26 +0000 (UTC) Ahmed Ashour wrote: > >Hi all, >Please note HtmlUnit 2.23 is released. >The main enhancements are: - Hover styles are supported - Various layout calculation improvements - DefaultJavaScriptErrorListener added - Bugfixes > >The full list of changes can be found in [1]. >Thanks to all the contributors, >Happy coding!The HtmlUnit team > >[1] http://htmlunit.sourceforge.net/changes-report.html#a2.23 > > > > > > >----< Inline text [text-plain-04.txt] >------------------ > >------------------------------------------------------------------------------ >What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic >patterns at an interface-level. Reveals which users, apps, and protocols are >consuming the most bandwidth. Provides multi-vendor support for NetFlow, >J-Flow, sFlow and other flows. Make informed decisions using capacity planning >reports.http://sdm.link/zohodev2dev > > >----< Inline text [text-plain-05.txt] >------------------ > >_______________________________________________ >Htmlunit-user mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: ricky b. <ric...@gm...> - 2016-07-27 16:29:59
|
Hi, Could you check that the current remort-item (on which you are calling getFirstByXpath) that you are getting is right, If yes then could you share snippet of code so I can ? Thanks, Debmalya On Wed, 27 Jul 2016 at 21:46 nonSonoPaola <non...@gm...> wrote: > Hi, > I tried with the ".//div[contains(@class, 'item-chart')]" query, with the > same result :( > > Thanks, > Laura > > 2016-07-27 17:56 GMT+02:00 ricky biswas <ric...@gm...>: > >> Hello Laura, >> >> If you do getFirstByXpath(".//div[contains(@class, 'item-chart')]") on >> report-item node then you will get the first div of under the report-item >> node. >> >> When you try to find the node by using '//', this will always try to find >> the node from the root html element, and when you try to find the xPath >> using './/' then it will search from the current node (in your case >> report-item). >> >> Thanks, >> Deb >> >> On Wed, 27 Jul 2016 at 20:11 nonSonoPaola <non...@gm...> >> wrote: >> >>> Hi, >>> I'm parsing an html like the attached one. >>> >>> I need to iterate on report items and, for each item, retrieve item-chart >>> and item-table nodes. >>> >>> If I perform getFirstByXPath or getByXPath methods (on a report-item >>> node) with the following xPath query: >>> >>> //div[contains(@class, 'item-chart')] >>> >>> I always get the first matching element in the html document instead the >>> first beginning from the current report item. >>> >>> >>> Can any one explain me what is wrong with my test case? >>> >>> >>> Thanks, >>> >>> Laura >>> >>> ------------------------------------------------------------------------------ >>> What NetFlow Analyzer can do for you? Monitors network bandwidth and >>> traffic >>> patterns at an interface-level. Reveals which users, apps, and protocols >>> are >>> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >>> J-Flow, sFlow and other flows. Make informed decisions using capacity >>> planning >>> reports.http://sdm.link/zohodev2dev >>> _______________________________________________ >>> Htmlunit-user mailing list >>> Htm...@li... >>> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >>> >> >> >> ------------------------------------------------------------------------------ >> What NetFlow Analyzer can do for you? Monitors network bandwidth and >> traffic >> patterns at an interface-level. Reveals which users, apps, and protocols >> are >> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >> J-Flow, sFlow and other flows. Make informed decisions using capacity >> planning >> reports.http://sdm.link/zohodev2dev >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> >> > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: nonSonoPaola <non...@gm...> - 2016-07-27 16:15:52
|
Hi, I tried with the ".//div[contains(@class, 'item-chart')]" query, with the same result :( Thanks, Laura 2016-07-27 17:56 GMT+02:00 ricky biswas <ric...@gm...>: > Hello Laura, > > If you do getFirstByXpath(".//div[contains(@class, 'item-chart')]") on > report-item node then you will get the first div of under the report-item > node. > > When you try to find the node by using '//', this will always try to find > the node from the root html element, and when you try to find the xPath > using './/' then it will search from the current node (in your case > report-item). > > Thanks, > Deb > > On Wed, 27 Jul 2016 at 20:11 nonSonoPaola <non...@gm...> wrote: > >> Hi, >> I'm parsing an html like the attached one. >> >> I need to iterate on report items and, for each item, retrieve item-chart >> and item-table nodes. >> >> If I perform getFirstByXPath or getByXPath methods (on a report-item >> node) with the following xPath query: >> >> //div[contains(@class, 'item-chart')] >> >> I always get the first matching element in the html document instead the >> first beginning from the current report item. >> >> >> Can any one explain me what is wrong with my test case? >> >> >> Thanks, >> >> Laura >> >> ------------------------------------------------------------------------------ >> What NetFlow Analyzer can do for you? Monitors network bandwidth and >> traffic >> patterns at an interface-level. Reveals which users, apps, and protocols >> are >> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >> J-Flow, sFlow and other flows. Make informed decisions using capacity >> planning >> reports.http://sdm.link/zohodev2dev >> _______________________________________________ >> Htmlunit-user mailing list >> Htm...@li... >> https://lists.sourceforge.net/lists/listinfo/htmlunit-user >> > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: ricky b. <ric...@gm...> - 2016-07-27 15:56:49
|
Hello Laura, If you do getFirstByXpath(".//div[contains(@class, 'item-chart')]") on report-item node then you will get the first div of under the report-item node. When you try to find the node by using '//', this will always try to find the node from the root html element, and when you try to find the xPath using './/' then it will search from the current node (in your case report-item). Thanks, Deb On Wed, 27 Jul 2016 at 20:11 nonSonoPaola <non...@gm...> wrote: > Hi, > I'm parsing an html like the attached one. > > I need to iterate on report items and, for each item, retrieve item-chart > and item-table nodes. > > If I perform getFirstByXPath or getByXPath methods (on a report-item node) > with the following xPath query: > > //div[contains(@class, 'item-chart')] > > I always get the first matching element in the html document instead the > first beginning from the current report item. > > > Can any one explain me what is wrong with my test case? > > > Thanks, > > Laura > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |
From: Ahmed A. <asa...@ya...> - 2016-07-27 14:58:24
|
Hi, Put a dot at the beginning, so it starts relative from the node, not from the document root. Ahmed From: nonSonoPaola <non...@gm...> To: htm...@li... Sent: Wednesday, July 27, 2016 4:39 PM Subject: [Htmlunit-user] getFirstByXPath help needed Hi, I'm parsing an html like the attached one.I need to iterate on report items and, for each item, retrieve item-chart and item-table nodes.If I perform getFirstByXPath or getByXPath methods (on a report-item node) with the following xPath query://div[contains(@class, 'item-chart')]I always get the first matching element in the html document instead the first beginning from the current report item. Can any one explain me what is wrong with my test case? Thanks, Laura |
From: nonSonoPaola <non...@gm...> - 2016-07-27 14:39:55
|
<!DOCTYPE html> <html> <head> <!-- ... --> </head> <body> <div class="report-title" id="default-report-title">test On Wed Jul 27 16:28:37 CEST 2016</div> <ul id="default-report"> <li class="report-item"> <div class="report-item-container"> <div class="item-chart" id="chart1"></div> <div class="item-table" id="data2"></div> </div> </li> <li class="report-item"> <div class="report-item-container"> <div class="item-chart" id="chart3"></div> </div> </li> <li class="report-item"> <div class="report-item-container"> <div class="item-chart" id="chart5"></div> <div class="item-table" id="data6"></div> </div> </li> </ul> </body> </html> |
From: Ahmed A. <asa...@ya...> - 2016-07-27 13:55:08
|
Hi all, Please note HtmlUnit 2.23 is released. The main enhancements are: - Hover styles are supported - Various layout calculation improvements - DefaultJavaScriptErrorListener added - Bugfixes The full list of changes can be found in [1]. Thanks to all the contributors, Happy coding!The HtmlUnit team [1] http://htmlunit.sourceforge.net/changes-report.html#a2.23 |
From: Ahmed A. <asa...@ya...> - 2016-07-27 13:03:01
|
Hi May, Which version do you use? With latest snapshot (a release is imminent), there are no errors. Ahmed From: "May, Benjamin L." <bl...@cu...> To: "'htm...@li...'" <htm...@li...> Sent: Wednesday, July 27, 2016 4:16 AM Subject: [Htmlunit-user] first time user Hey all! First time using this library, just trying to get a page that requires javascript... Code snippet: WebClient webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(false); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setPrintContentOnFailingStatusCode(true); webClient.getOptions().setThrowExceptionOnScriptError(false); String link = "http://nycprop.nyc.gov/nycproperty/statements/flk/jsp/stmtassessflk.jsp?statementId=104487723"; HtmlPage page = webClient.getPage(link); webClient.waitForBackgroundJavaScript(30 * 1000); String pageAsText = page.asText(); System.out.println(pageAsText); And I am getting a HUGE stackoverflow exception. If you try and view the URL in a browser with JS disabled you get a message about needing to turn it on, but there's barely any javascript in the page source from what I can see... TIA! |
From: Ahmed A. <asa...@ya...> - 2016-07-27 12:55:34
|
Hi guys, I'm trying to use HtmlUnit jars in my application and it works just fine on my machine that has jdk 1.8. but when I try to run it on the server machine that has jdk 1.5 I get the following error: Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version I configured the compiler in my IDE (using JDeveloper) to generate class files in 1.5 version, and it worked previously (before I added HtmlUnit jars) when I had this problem. But this doesn't help when I'm using HtmlUnit. I wonder whether it's possible to run the latest HtmlUnit jars with jdk 1.5? thanks, Boris. |
From: May, B. L. <bl...@cu...> - 2016-07-27 02:17:07
|
Hey all! First time using this library, just trying to get a page that requires javascript... Code snippet: WebClient webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(false); webClient.getOptions().setRedirectEnabled(true); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setPrintContentOnFailingStatusCode(true); webClient.getOptions().setThrowExceptionOnScriptError(false); String link = "http://nycprop.nyc.gov/nycproperty/statements/flk/jsp/stmtassessflk.jsp?statementId=104487723"; HtmlPage page = webClient.getPage(link); webClient.waitForBackgroundJavaScript(30 * 1000); String pageAsText = page.asText(); System.out.println(pageAsText); And I am getting a HUGE stackoverflow exception. If you try and view the URL in a browser with JS disabled you get a message about needing to turn it on, but there's barely any javascript in the page source from what I can see... TIA! |
From: Davi M. C. <dav...@gm...> - 2016-07-16 23:58:39
|
Hi Ahmed, I saved locally html, javascript and css files. I do not have the source code that is on the server side, because it is the website is not mine. I'm just trying to use the service provided by this website. |
From: Ahmed A. <asa...@ya...> - 2016-07-15 10:14:20
|
Hi Davi, Because you need to also have the server-side part locally. In this case, I would use a proxy againt the website and modify only the JavaScript file in question. Ahmed From: Davi Medeiros Cabral <dav...@gm...> To: htm...@li... Sent: Friday, July 15, 2016 12:55 AM Subject: Re: [Htmlunit-user] HtmlUnit, Ajax and Input without submit button Hi Ahmed, I read the text you passed me, but when saved html page on my computer to debug the code by entering the alert commands in JavaScript fi, the input field "Adicionar Símbolo" does not work locally. On Wed, Jul 13, 2016 at 9:14 AM, Ahmed Ashour <asa...@ya...> wrote: Hi Davi, Please read http://htmlunit.sourceforge.net/submittingJSBugs.html Knowing how the website in question works, takes time to investigate. Ahmed From: Davi Medeiros Cabral <dav...@gm...> To: htm...@li... Sent: Sunday, July 10, 2016 1:08 PM Subject: Re: [Htmlunit-user] HtmlUnit, Ajax and Input without submit button Hello, I made some changes in my code, leaving it more complete. Still, it does not work, my code enters an infinite loop in print "Waiting for symbol tag ...". That is, I can not insert a symbol from my code, though I can do it in the browser. BrowserVersion browserVersion = BrowserVersion.FIREFOX_45; WebClient webClient = new WebClient(browserVersion); webClient.setAjaxController(new SyncAjaxController()); webClient.setCookieManager(new CookieManager()); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(true); webClient.getOptions().setUseInsecureSSL(true); try { System.out.println("Acessing webpage..."); HtmlPage page; page = webClient.getPage( "https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/"); List<Node> nodesAdicionarSimbolo = null; while (nodesAdicionarSimbolo == null || (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() == 0)) { nodesAdicionarSimbolo = (List<Node>) page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); System.out.println("Looking for 'Adicionar Símbolo'..."); } System.out.println("'Adicionar Símbolo' found!"); { String symbol = "BBAS3"; HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo.get(0); System.out.println("Putting symbol in 'Adicionar Símbolo'..."); inputAdicionarSimbolo.setTextContent(symbol); { HtmlElement input = (HtmlElement) inputAdicionarSimbolo; input.focus(); input.type(symbol); System.out.println("Pressing the Enter key..."); page = (HtmlPage) input.type('\n'); } } { List<Node> nodesCotacaoDiaria; do { nodesCotacaoDiaria = (List<Node>) page.getByXPath("//div[@class='symbol']"); System.out.println("Waiting for symbol tag..."); } while (nodesCotacaoDiaria == null || (nodesCotacaoDiaria != null && nodesCotacaoDiaria.size() == 0)); System.out.println("Symbol tag found!"); } } catch (Exception e) { e.printStackTrace(); } webClient.close(); ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |
From: Davi M. C. <dav...@gm...> - 2016-07-14 22:56:13
|
Hi Ahmed, I read the text you passed me, but when saved html page on my computer to debug the code by entering the alert commands in JavaScript fi, the input field "Adicionar Símbolo" does not work locally. On Wed, Jul 13, 2016 at 9:14 AM, Ahmed Ashour <asa...@ya...> wrote: > Hi Davi, > > Please read http://htmlunit.sourceforge.net/submittingJSBugs.html > > Knowing how the website in question works, takes time to investigate. > > Ahmed > > > ------------------------------ > *From:* Davi Medeiros Cabral <dav...@gm...> > *To:* htm...@li... > *Sent:* Sunday, July 10, 2016 1:08 PM > *Subject:* Re: [Htmlunit-user] HtmlUnit, Ajax and Input without submit > button > > Hello, > > I made some changes in my code, leaving it more complete. Still, it does > not work, my code enters an infinite loop in print "Waiting for symbol tag > ...". That is, I can not insert a symbol from my code, though I can do it > in the browser. > > BrowserVersion browserVersion = BrowserVersion.FIREFOX_45; > WebClient webClient = new WebClient(browserVersion); > webClient.setAjaxController(new SyncAjaxController()); > webClient.setCookieManager(new CookieManager()); > webClient.getOptions().setJavaScriptEnabled(true); > webClient.getOptions().setCssEnabled(true); > webClient.getOptions().setUseInsecureSSL(true); > try { > System.out.println("Acessing webpage..."); > HtmlPage page; > page = webClient.getPage( > " > https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ > "); > List<Node> nodesAdicionarSimbolo = null; > > while (nodesAdicionarSimbolo == null > || (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() == 0)) { > nodesAdicionarSimbolo = (List<Node>) > page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); > System.out.println("Looking for 'Adicionar Símbolo'..."); > } > System.out.println("'Adicionar Símbolo' found!"); > { > String symbol = "BBAS3"; > HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) > nodesAdicionarSimbolo.get(0); > System.out.println("Putting symbol in 'Adicionar Símbolo'..."); > inputAdicionarSimbolo.setTextContent(symbol); > { > HtmlElement input = (HtmlElement) inputAdicionarSimbolo; > input.focus(); > input.type(symbol); > System.out.println("Pressing the Enter key..."); > page = (HtmlPage) input.type('\n'); > } > } > { > List<Node> nodesCotacaoDiaria; > do { > nodesCotacaoDiaria = (List<Node>) > page.getByXPath("//div[@class='symbol']"); > System.out.println("Waiting for symbol tag..."); > } while (nodesCotacaoDiaria == null || (nodesCotacaoDiaria != null && > nodesCotacaoDiaria.size() == 0)); > System.out.println("Symbol tag found!"); > } > } catch (Exception e) { > e.printStackTrace(); > } > webClient.close(); > > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |
From: Ahmed A. <asa...@ya...> - 2016-07-13 12:58:37
|
Hi Tristan, I am not familiar with Android. There is a Google Application Engine mode, which also doesn't expose all standard Java classes. HtmlUnit detects it in GAEUtils: return System.getProperty("com.google.appengine.runtime.environment") != null; Try to set that property and test. Also, please provide some details of what classes used by HtmlUnit not supported by Android. Ahmed From: Tristan Janicki <tt7...@gm...> To: htm...@li... Sent: Wednesday, July 6, 2016 5:16 AM Subject: [Htmlunit-user] Use in android Is there any way to enable use of the package on Android? The primary problem is that not all of the java packages are included in Android and so the references fail but how would one go about including them? |
From: Ahmed A. <asa...@ya...> - 2016-07-13 12:38:47
|
Hi, Thanks for the minimal test case, fixed in SVN. You can get latest build from [1]. Ahmed[1] https://ci.canoo.com/teamcity/viewLog.html?buildTypeId=HtmlUnit_FastBuild&buildId=lastSuccessful&tab=artifacts From: 蒲云 <cl...@12...> To: htmlunit-user <htm...@li...> Sent: Sunday, July 10, 2016 6:09 AM Subject: [Htmlunit-user] A test case about js native function getComputedStyle The following html shows "ok!" in browsers, but exceptions caught by htmlunit。 html code: <html><head><title>test</title></head> <body> <div id="target">origin</div> <script type="text/javascript"> try{ getComputedStyle(void 0); }catch(e){}; document.getElementById("target").textContent="ok!"; </script> </body> </html> Java code: public static void main(String[] args) throws Exception { String link = "file:test_002.html"; try (WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED)) { webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); HtmlPage page = webClient.getPage(link); webClient.waitForBackgroundJavaScriptStartingBefore(800); webClient.waitForBackgroundJavaScript(800); System.out.println(page.getElementById("target").getTextContent()); // should be ok! } } | | | | | | | | | | | Log in to TeamCity — TeamCity Powerful Continuous Integration and Build Server | | | | |
From: Ahmed A. <asa...@ya...> - 2016-07-13 12:14:12
|
Hi Davi, Please read http://htmlunit.sourceforge.net/submittingJSBugs.html Knowing how the website in question works, takes time to investigate. Ahmed From: Davi Medeiros Cabral <dav...@gm...> To: htm...@li... Sent: Sunday, July 10, 2016 1:08 PM Subject: Re: [Htmlunit-user] HtmlUnit, Ajax and Input without submit button Hello, I made some changes in my code, leaving it more complete. Still, it does not work, my code enters an infinite loop in print "Waiting for symbol tag ...". That is, I can not insert a symbol from my code, though I can do it in the browser. BrowserVersion browserVersion = BrowserVersion.FIREFOX_45; WebClient webClient = new WebClient(browserVersion); webClient.setAjaxController(new SyncAjaxController()); webClient.setCookieManager(new CookieManager()); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(true); webClient.getOptions().setUseInsecureSSL(true); try { System.out.println("Acessing webpage..."); HtmlPage page; page = webClient.getPage( "https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/"); List<Node> nodesAdicionarSimbolo = null; while (nodesAdicionarSimbolo == null || (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() == 0)) { nodesAdicionarSimbolo = (List<Node>) page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); System.out.println("Looking for 'Adicionar Símbolo'..."); } System.out.println("'Adicionar Símbolo' found!"); { String symbol = "BBAS3"; HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo.get(0); System.out.println("Putting symbol in 'Adicionar Símbolo'..."); inputAdicionarSimbolo.setTextContent(symbol); { HtmlElement input = (HtmlElement) inputAdicionarSimbolo; input.focus(); input.type(symbol); System.out.println("Pressing the Enter key..."); page = (HtmlPage) input.type('\n'); } } { List<Node> nodesCotacaoDiaria; do { nodesCotacaoDiaria = (List<Node>) page.getByXPath("//div[@class='symbol']"); System.out.println("Waiting for symbol tag..."); } while (nodesCotacaoDiaria == null || (nodesCotacaoDiaria != null && nodesCotacaoDiaria.size() == 0)); System.out.println("Symbol tag found!"); } } catch (Exception e) { e.printStackTrace(); } webClient.close(); |
From: Ahmed A. <asa...@ya...> - 2016-07-12 17:20:04
|
Hi Ziqi, Thanks for reporting, fixed in SVN. The reason was that HtmlUnit tries to load the content of <link rel="alternate" href="android-app://something> You can get latest build (once green) from [1]. Ahmed, [1] https://ci.canoo.com/teamcity/viewLog.html?buildTypeId=HtmlUnit_FastBuild&buildId=lastSuccessful&tab=artifacts From: Ziqi Zhang <ziq...@sh...> To: htm...@li... Sent: Monday, July 11, 2016 6:06 PM Subject: [Htmlunit-user] org.apache.http.client.ClientProtocolException (ver2.22) Hi I am testing the following code to download a webpage from wikipedia. and it generates a long exception as shown below. Any ideas much appreciated! Thanks Code: ------------- final WebClient webClient = new WebClient(); try { final HtmlPage page = webClient.getPage("https://en.wikipedia.org/wiki/Commedia_all%27italiana"); page.save(new File("blah/saved.html")); System.out.println(); }catch (Exception e){ e.printStackTrace(); } ---------------------- |
From: Ziqi Z. <ziq...@sh...> - 2016-07-11 16:06:29
|
Hi I am testing the following code to download a webpage from wikipedia. and it generates a long exception as shown below. Any ideas much appreciated! Thanks Code: ------------- final WebClient webClient =new WebClient(); try { final HtmlPage page = webClient.getPage("https://en.wikipedia.org/wiki/Commedia_all%27italiana"); page.save(new File("blah/saved.html")); System.out.println(); }catch (Exception e){ e.printStackTrace(); } ---------------------- Exception: 2016-07-11 16:58:37 ERROR StrictErrorReporter:82 - runtimeError: message=[An invalid or illegal selector was specified (selector: '*,:x' error: Invalid selector: :x).] sourceName=[https://en.wikipedia.org/w/load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=QIEfZWVM] line=[16] lineSource=[null] lineOffset=[0] 2016-07-11 16:58:37 ERROR WebConsole:442 - TypeError: Expected argument of type object, but instead had type object TypeError: Expected argument of type object, but instead had type object org.apache.http.client.ClientProtocolException at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:183) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1351) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1268) at com.gargoylesoftware.htmlunit.html.HtmlLink.getWebResponse(HtmlLink.java:185) at com.gargoylesoftware.htmlunit.html.HtmlLink.getWebResponse(HtmlLink.java:166) at com.gargoylesoftware.htmlunit.html.XmlSerializer.getAttributesFor(XmlSerializer.java:210) at com.gargoylesoftware.htmlunit.html.XmlSerializer.readAttributes(XmlSerializer.java:138) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printOpeningTag(XmlSerializer.java:121) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printXml(XmlSerializer.java:91) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printXml(XmlSerializer.java:101) at com.gargoylesoftware.htmlunit.html.XmlSerializer.printXml(XmlSerializer.java:101) at com.gargoylesoftware.htmlunit.html.XmlSerializer.asXml(XmlSerializer.java:81) at com.gargoylesoftware.htmlunit.html.XmlSerializer.save(XmlSerializer.java:62) at com.gargoylesoftware.htmlunit.html.HtmlPage.save(HtmlPage.java:2167) at uk.ac.shef.dcs.sti.ui.InputFilePreview.main(InputFilePreview.java:21) Caused by: org.apache.http.HttpException: android-app protocol is not supported at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:88) at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183) ... 16 more |
From: Davi M. C. <dav...@gm...> - 2016-07-10 11:09:04
|
Hello, I made some changes in my code, leaving it more complete. Still, it does not work, my code enters an infinite loop in print "Waiting for symbol tag ...". That is, I can not insert a symbol from my code, though I can do it in the browser. BrowserVersion browserVersion = BrowserVersion.FIREFOX_45; WebClient webClient = new WebClient(browserVersion); webClient.setAjaxController(new SyncAjaxController()); webClient.setCookieManager(new CookieManager()); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(true); webClient.getOptions().setUseInsecureSSL(true); try { System.out.println("Acessing webpage..."); HtmlPage page; page = webClient.getPage( " https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ "); List<Node> nodesAdicionarSimbolo = null; while (nodesAdicionarSimbolo == null || (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() == 0)) { nodesAdicionarSimbolo = (List<Node>) page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); System.out.println("Looking for 'Adicionar Símbolo'..."); } System.out.println("'Adicionar Símbolo' found!"); { String symbol = "BBAS3"; HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo.get(0); System.out.println("Putting symbol in 'Adicionar Símbolo'..."); inputAdicionarSimbolo.setTextContent(symbol); { HtmlElement input = (HtmlElement) inputAdicionarSimbolo; input.focus(); input.type(symbol); System.out.println("Pressing the Enter key..."); page = (HtmlPage) input.type('\n'); } } { List<Node> nodesCotacaoDiaria; do { nodesCotacaoDiaria = (List<Node>) page.getByXPath("//div[@class='symbol']"); System.out.println("Waiting for symbol tag..."); } while (nodesCotacaoDiaria == null || (nodesCotacaoDiaria != null && nodesCotacaoDiaria.size() == 0)); System.out.println("Symbol tag found!"); } } catch (Exception e) { e.printStackTrace(); } webClient.close(); On Sat, Jul 9, 2016 at 12:02 AM, Davi Medeiros Cabral <dav...@gm... > wrote: > Hello, > > I'm doing a system which need to fill some fields the following website: > > > https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ > > To be more precise, I am trying to insert a symbol in the list of symbols > that site, using, for this, the input field "Adicionar Símbolo". > > <input class="wl-symbol-edit" placeholder="Adicionar Símbolo" > maxlength="1000" style="text-transform: none; font-weight: normal;" > autocomplete="off" type="text"> > > Therefore, I wrote the following code: > > BrowserVersion browserVersion = BrowserVersion.INTERNET_EXPLORER_11; > webClient = new WebClient(browserVersion); > webClient.getOptions().setCssEnabled(true); > webClient.setSyncAjaxMode(new SyncAjaxController()); > webClient.getOptions().setJavaScriptEnabled(true); HtmlPage page = > webClient.getPage(url); List<Node> nodesAdicionarSimbolo = (List<Node>) > page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); if > (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() > 0) { > HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo. > get(0); HtmlElement input = (HtmlElement) inputAdicionarSimbolo; > input.focus(); input.type("BBAS3\n"); System.out.println(page.asXml()); } > > However, the println does not return the below structure, as in the > website. > > <div class="symbol"><span class="name">BBAS3</span>... > > What am I doing wrong? > |
From: Davi M. C. <dav...@gm...> - 2016-07-10 11:07:07
|
Hello, I made some changes in my code, leaving it more complete. Still, it does not work, my code enters an infinite loop in print "Waiting for symbol tag ...". That is, I can not insert a symbol from my code, though I can do it in the browser. BrowserVersion browserVersion = BrowserVersion.FIREFOX_45; WebClient webClient = new WebClient(browserVersion); webClient.setAjaxController(new SyncAjaxController()); webClient.setCookieManager(new CookieManager()); webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setCssEnabled(true); webClient.getOptions().setUseInsecureSSL(true); try { System.out.println("Acessing webpage..."); HtmlPage page; page = webClient.getPage( " https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ "); List<Node> nodesAdicionarSimbolo = null; while (nodesAdicionarSimbolo == null || (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() == 0)) { nodesAdicionarSimbolo = (List<Node>) page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); System.out.println("Looking for 'Adicionar Símbolo'..."); } System.out.println("'Adicionar Símbolo' found!"); { String symbol = "BBAS3"; HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo.get(0); System.out.println("Putting symbol in 'Adicionar Símbolo'..."); inputAdicionarSimbolo.setTextContent(symbol); { HtmlElement input = (HtmlElement) inputAdicionarSimbolo; input.focus(); input.type(symbol); System.out.println("Pressing the Enter key..."); page = (HtmlPage) input.type('\n'); } } { List<Node> nodesCotacaoDiaria; do { nodesCotacaoDiaria = (List<Node>) page.getByXPath("//div[@class='symbol']"); System.out.println("Waiting for symbol tag..."); } while (nodesCotacaoDiaria == null || (nodesCotacaoDiaria != null && nodesCotacaoDiaria.size() == 0)); System.out.println("Symbol tag found!"); } } catch (Exception e) { e.printStackTrace(); } webClient.close(); On Sat, Jul 9, 2016 at 12:02 AM, Davi Medeiros Cabral <dav...@gm... > wrote: > Hello, > > I'm doing a system which need to fill some fields the following website: > > > https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ > > To be more precise, I am trying to insert a symbol in the list of symbols > that site, using, for this, the input field "Adicionar Símbolo". > > <input class="wl-symbol-edit" placeholder="Adicionar Símbolo" > maxlength="1000" style="text-transform: none; font-weight: normal;" > autocomplete="off" type="text"> > > Therefore, I wrote the following code: > > BrowserVersion browserVersion = BrowserVersion.INTERNET_EXPLORER_11; > webClient = new WebClient(browserVersion); > webClient.getOptions().setCssEnabled(true); > webClient.setSyncAjaxMode(new SyncAjaxController()); > webClient.getOptions().setJavaScriptEnabled(true); HtmlPage page = > webClient.getPage(url); List<Node> nodesAdicionarSimbolo = (List<Node>) > page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); if > (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() > 0) { > HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo. > get(0); HtmlElement input = (HtmlElement) inputAdicionarSimbolo; > input.focus(); input.type("BBAS3\n"); System.out.println(page.asXml()); } > > However, the println does not return the below structure, as in the > website. > > <div class="symbol"><span class="name">BBAS3</span>... > > What am I doing wrong? > |
From: 蒲云 <cl...@12...> - 2016-07-10 04:09:44
|
The following html shows "ok!" in browsers, but exceptions caught by htmlunit。 html code: <html><head><title>test</title></head> <body> <div id="target">origin</div> <script type="text/javascript"> try{ getComputedStyle(void 0); }catch(e){}; document.getElementById("target").textContent="ok!"; </script> </body> </html> Java code: public static void main(String[] args) throws Exception { String link = "file:test_002.html"; try (WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED)) { webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); HtmlPage page = webClient.getPage(link); webClient.waitForBackgroundJavaScriptStartingBefore(800); webClient.waitForBackgroundJavaScript(800); System.out.println(page.getElementById("target").getTextContent()); // should be ok! } } |
From: 蒲云 <cl...@12...> - 2016-07-10 03:59:06
|
The following html shows "ok!" in browsers, but exceptions caught by htmlunit。 html code: <html><head><title>test</title></head> <body> <div id="target">origin</div> <script type="text/javascript"> var a = {}; a.prototype = { foo : foo, }; var container = { foo : function foo() { } }; var foo = container.foo; document.getElementById("target").textContent="ok!"; </script> </body></html> Java code: public static void main(String[] args) throws Exception { String link = "file:test_001.html"; try (WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED)) { webClient.getOptions().setJavaScriptEnabled(true); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); HtmlPage page = webClient.getPage(link); webClient.waitForBackgroundJavaScriptStartingBefore(800); webClient.waitForBackgroundJavaScript(800); System.out.println(page.getElementById("target").getTextContent()); // should be ok! } } |
From: Davi M. C. <dav...@gm...> - 2016-07-09 03:03:11
|
Hello, I'm doing a system which need to fill some fields the following website: https://dwq4do82y8xi7.cloudfront.net/bovespa/widgetembed/?symbol=IBOV&interval=1&hidesidetoolbar=0&symboledit=1&toolbarbg=f1f3f6&editablewatchlist=1&details=1&studies=&widgetbarwidth=300&hideideas=1&theme=White&style=3&timezone=exchange&withdateranges=1&studies_overrides=%7B%7D&overrides=%7B%7D&enabled_features=%5B%5D&disabled_features=%5B%5D&locale=pt&utmsource=www.bmfbovespa.com.br&utmmedium=www.bmfbovespa.com.br/pt_br/servicos/market-data/cotacoes/ To be more precise, I am trying to insert a symbol in the list of symbols that site, using, for this, the input field "Adicionar Símbolo". <input class="wl-symbol-edit" placeholder="Adicionar Símbolo" maxlength="1000" style="text-transform: none; font-weight: normal;" autocomplete="off" type="text"> Therefore, I wrote the following code: BrowserVersion browserVersion = BrowserVersion.INTERNET_EXPLORER_11; webClient = new WebClient(browserVersion); webClient.getOptions().setCssEnabled(true); webClient.setSyncAjaxMode(new SyncAjaxController()); webClient.getOptions().setJavaScriptEnabled(true); HtmlPage page = webClient.getPage(url); List<Node> nodesAdicionarSimbolo = (List<Node>) page.getByXPath("//input[@placeholder='Adicionar Símbolo']"); if (nodesAdicionarSimbolo != null && nodesAdicionarSimbolo.size() > 0) { HtmlTextInput inputAdicionarSimbolo = (HtmlTextInput) nodesAdicionarSimbolo. get(0); HtmlElement input = (HtmlElement) inputAdicionarSimbolo; input.focus(); input.type("BBAS3\n"); System.out.println(page.asXml()); } However, the println does not return the below structure, as in the website. <div class="symbol"><span class="name">BBAS3</span>... What am I doing wrong? |