java - htmlunit Cannot read property "push" from undefined -


i'm trying crawl website using htmlunit. whenever run though outputs following error:

caused by: net.sourceforge.htmlunit.corejs.javascript.ecmaerror: typeerror: cannot read property "push" undefined (https://www.kinoheld.de/dist/prod/0.4.7/widget.js#1) 

now don't know js, read push kind of array operation. seems standard me , don't know why not supported htmlunit.

here code i'm using far:

public static void main(string[] args) throws ioexception {     webclient web = new webclient(browserversion.firefox_45);     web.getoptions().setuseinsecuressl(true);     string url = "https://www.kinoheld.de/kino-muenchen/royal-filmpalast/vorstellung/280823/?mode=widget&showid=280828#panel-seats";     web.getoptions().setthrowexceptiononfailingstatuscode(false);     web.waitforbackgroundjavascript(9000);     htmlpage response = web.getpage(url);      system.out.println(response.gettitletext()); } 

what missing? there way around or way fix this? in advance!

i've encountered similar problem before. issue html unit being designed test harness framework rather web scraping one. running latest version of html unit?

i able run code adding both setthrowexceptiononscripterror(false) (as mentioned in coffee converter's answer) line adding java.util.logging.logger.getlogger("com.gargoylesoftware").setlevel(java.util.logging.level.off); @ top of method disable log dump. yielded output of:

royal filmpalast münchen münchen | kinoheld.de 

full code follows:

public static void main(string[] args) throws ioexception {      java.util.logging.logger.getlogger("com.gargoylesoftware").setlevel(java.util.logging.level.off);      webclient webclient = new webclient(browserversion.firefox_45);     string url = "https://www.kinoheld.de/kino-muenchen/royal-filmpalast/vorstellung/280823/?mode=widget&showid=280828#panel-seats";      webclient.getoptions().setuseinsecuressl(true);     webclient.getoptions().setthrowexceptiononscripterror(false);     webclient.getoptions().setthrowexceptiononfailingstatuscode(false);     webclient.waitforbackgroundjavascript(9000);     htmlpage response = webclient.getpage(url);      system.out.println(response.gettitletext()); } 

this run on redhat command line html unit 2.2.1. hope helps.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -