0

Im trying to make a program that goes into google and searches it's contents for programing blogs and the things alike. however when I enter the google domain I get a long error. Im using HtmlUnit and currently am still learning it, so it's probably something simple. my code is as fallows im just calling the connectToLink method in the main method

    /**
 * Connects to the desired link provided. Uses the Scanner class to provide
 * the input saves the page as a connection.
 */
private static void connectToLink() {
    Boolean connected = false;
    String uInput;

    while (!connected) {
        System.out.println("Please provide a valid link");
        uInput = input.nextLine();
        if (wManage.linkChecker(uInput)) {
            //return the connection
            page = wManage.getPage();
            connected = true;
        }
    }
}

this is my wManage class. I have it with both the javaScript and css variables set to true

public class WebManager {

HtmlPage page;
WebClient web;

//all objects are going to try to make a website, so why not have it passed when creating the class?
/**
 * gives the class specific way to handle a website
 *
 * @param css turns on and off css
 * @param javaScript turns on and off javascript support
 */
public WebManager(Boolean css, Boolean javaScript) {
    //stop unnecessary errors
    //LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.NoOpLog");

    //java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);
    //java.util.logging.Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.OFF);

    //Modify the browser here
    web = new WebClient(BrowserVersion.CHROME);
    //Modify the default browser
    web.getOptions().setJavaScriptEnabled(javaScript);
    web.getOptions().setThrowExceptionOnScriptError(true);
    web.getOptions().setCssEnabled(css);
}

/**
 * checks if the link provided is able to connect to the site
 *
 * @param link the link to check
 * @return if it was able to connect to the site
 */
public Boolean linkChecker(String link) {
    try {
        page = web.getPage(link);
        web.waitForBackgroundJavaScript(500);
        System.out.println("Connected");
        return true;
    } catch (IOException | FailingHttpStatusCodeException ex) {
        System.out.println("Unable to connect");
        return false;
    }
}

/**
 * gets the website the user is trying to reach
 *
 * @return a programatic implementation of the website
 */
public HtmlPage getPage() {
    return page;
}

`======= EXCEPTION START ========
Exception class=[net.sourceforge.htmlunit.corejs.javascript.EvaluatorException]
com.gargoylesoftware.htmlunit.ScriptException: identifier is a reserved word: class (script in https://www.google.com/ from (69, 58657) to (115, 10)#80)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:1001)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:590)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:484)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:349)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:830)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:796)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:842)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript(HtmlPage.java:964)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport.executeInlineScriptIfNeeded(ScriptElementSupport.java:380)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport.executeScriptIfNeeded(ScriptElementSupport.java:230)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport$1.execute(ScriptElementSupport.java:120)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport.onAllChildrenAddedToPage(ScriptElementSupport.java:143)
    at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:191)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:572)
    at net.sourceforge.htmlunit.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:451)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:517)
    at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1242)
    at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1169)
    at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:218)
    at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:310)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3145)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2091)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:918)
    at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:367)
    at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:318)
    at net.sourceforge.htmlunit.xerces.parsers.XMLParser.parse(XMLParser.java:80)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.parse(HtmlUnitNekoDOMBuilder.java:773)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser.parse(HtmlUnitNekoHtmlParser.java:204)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:299)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:219)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:669)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:571)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:489)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:534)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:516)
    at com.joshua.buybot.WebManager.linkChecker(WebManager.java:55)
    at com.joshua.buybot.BuyBot.connectToLink(BuyBot.java:73)
    at com.joshua.buybot.BuyBot.main(BuyBot.java:28)
Caused by: net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: identifier is a reserved word: class (script in https://www.google.com/ from (69, 58657) to (115, 10)#80)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$HtmlUnitErrorReporter.error(HtmlUnitContextFactory.java:435)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:257)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:336)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:327)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.primaryExpr(Parser.java:3145)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2711)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2717)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2614)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expExpr(Parser.java:2534)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2517)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2503)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2486)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2464)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2440)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2431)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2422)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2413)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2404)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2395)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2362)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:2320)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.variables(Parser.java:2168)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1197)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statements(Parser.java:1063)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.block(Parser.java:1993)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1218)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.getNextStatementAfterInlineComments(Parser.java:1458)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.tryStatement(Parser.java:1637)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1173)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parseFunctionBody(Parser.java:736)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:911)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:845)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.primaryExpr(Parser.java:3081)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2711)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2614)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expExpr(Parser.java:2534)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2517)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2503)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2486)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2464)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2440)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2431)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2422)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2413)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2404)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2395)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2362)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:2320)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expr(Parser.java:2303)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parenExpr(Parser.java:3175)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.primaryExpr(Parser.java:3097)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2711)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2614)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expExpr(Parser.java:2534)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2517)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2503)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2486)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2464)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2440)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2431)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2422)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2413)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2404)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2395)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2362)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:2320)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expr(Parser.java:2303)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1249)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:632)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:562)
    at net.sourceforge.htmlunit.corejs.javascript.Context.parse(Context.java:2549)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2480)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1448)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:221)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1436)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$1.doRun(JavaScriptEngine.java:821)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:984)
    ... 38 more
Enclosed exception: 
net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: identifier is a reserved word: class (script in https://www.google.com/ from (69, 58657) to (115, 10)#80)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$HtmlUnitErrorReporter.error(HtmlUnitContextFactory.java:435)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addError(Parser.java:257)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:336)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.reportError(Parser.java:327)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.primaryExpr(Parser.java:3145)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2711)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2717)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2614)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expExpr(Parser.java:2534)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2517)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2503)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2486)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2464)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2440)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2431)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2422)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2413)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2404)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2395)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2362)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:2320)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.variables(Parser.java:2168)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1197)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statements(Parser.java:1063)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.block(Parser.java:1993)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1218)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.getNextStatementAfterInlineComments(Parser.java:1458)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.tryStatement(Parser.java:1637)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1173)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parseFunctionBody(Parser.java:736)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:911)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.function(Parser.java:845)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.primaryExpr(Parser.java:3081)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2711)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2614)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expExpr(Parser.java:2534)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2517)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2503)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2486)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2464)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2440)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2431)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2422)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2413)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2404)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2395)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2362)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:2320)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expr(Parser.java:2303)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parenExpr(Parser.java:3175)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.primaryExpr(Parser.java:3097)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.memberExpr(Parser.java:2711)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.unaryExpr(Parser.java:2614)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expExpr(Parser.java:2534)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.mulExpr(Parser.java:2517)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.addExpr(Parser.java:2503)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.shiftExpr(Parser.java:2486)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.relExpr(Parser.java:2464)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.eqExpr(Parser.java:2440)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitAndExpr(Parser.java:2431)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitXorExpr(Parser.java:2422)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.bitOrExpr(Parser.java:2413)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.andExpr(Parser.java:2404)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.orExpr(Parser.java:2395)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.condExpr(Parser.java:2362)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.assignExpr(Parser.java:2320)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.expr(Parser.java:2303)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statementHelper(Parser.java:1249)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.statement(Parser.java:1104)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:632)
    at net.sourceforge.htmlunit.corejs.javascript.Parser.parse(Parser.java:562)
    at net.sourceforge.htmlunit.corejs.javascript.Context.parse(Context.java:2549)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileImpl(Context.java:2480)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1448)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory$TimeoutContext.compileString(HtmlUnitContextFactory.java:221)
    at net.sourceforge.htmlunit.corejs.javascript.Context.compileString(Context.java:1436)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$1.doRun(JavaScriptEngine.java:821)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:984)
    at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:590)
    at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:484)
    at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:349)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:830)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.compile(JavaScriptEngine.java:796)
    at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:842)
    at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript(HtmlPage.java:964)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport.executeInlineScriptIfNeeded(ScriptElementSupport.java:380)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport.executeScriptIfNeeded(ScriptElementSupport.java:230)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport$1.execute(ScriptElementSupport.java:120)
    at com.gargoylesoftware.htmlunit.html.ScriptElementSupport.onAllChildrenAddedToPage(ScriptElementSupport.java:143)
    at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:191)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:572)
    at net.sourceforge.htmlunit.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:451)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:517)
    at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1242)
    at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1169)
    at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.endElement(DefaultFilter.java:218)
    at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.endElement(NamespaceBinder.java:310)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3145)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2091)
    at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:918)
    at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:367)
    at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:318)
    at net.sourceforge.htmlunit.xerces.parsers.XMLParser.parse(XMLParser.java:80)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.parse(HtmlUnitNekoDOMBuilder.java:773)
    at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser.parse(HtmlUnitNekoHtmlParser.java:204)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:299)
    at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:219)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:669)
    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:571)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:489)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:396)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:534)
    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:516)
    at com.joshua.buybot.WebManager.linkChecker(WebManager.java:55)
    at com.joshua.buybot.BuyBot.connectToLink(BuyBot.java:73)
    at com.joshua.buybot.BuyBot.main(BuyBot.java:28)
== CALLING JAVASCRIPT ==
this.gbar_=this.gbar_||{};(function(_){var window=this;
try{
_.be=function(a,b,c){if(!a.o)if(c instanceof Array)for(var d of c)_.be(a,b,d);else{d=(0,_.x)(a.F,a,b);const e=a.B+c;a.B++;b.setAttribute("data-eqid",e);a.D[e]=d;b&&b.addEventListener?b.addEventListener(c,d,!1):b&&b.attachEvent?b.attachEvent("on"+c,d):a.A.log(Error("x`"+b))}};
}catch(e){_._DumpException(e)}
try{
_.ce=function(){if(!_.m.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{_.m.addEventListener("test",()=>{},b),_.m.removeEventListener("test",()=>{},b)}catch(c){}return a}();_.de=_.tb?"webkitTransitionEnd":"transitionend";
}catch(e){_._DumpException(e)}
try{
var ee=document.querySelector(".gb_M .gb_e"),fe=document.querySelector("#gb.gb_Qc");ee&&!fe&&_.be(_.Rd,ee,"click");
}catch(e){_._DumpException(e)}
try{
_.Sh=function(a){if(a.A)return a.A;for(const b in a.j)if(a.j[b].yb()&&a.j[b].G())return a.j[b];return null};_.Th=function(a,b){b&&_.Sh(a)&&b!=_.Sh(a)&&_.Sh(a).ua(!1);a.A=b};_.Uh=function(a,b){a.j[b.S()]=b};var Vh=new class extends _.I{constructor(){var a=_.rc;super();this.D=a;this.A=null;this.o={};this.F={};this.j={};this.B=null}C(a){this.j[a]&&(_.Sh(this)&&_.Sh(this).S()==a||this.j[a].ua(!0))}Za(a){this.B=a;for(const b in this.j)this.j[b].yb()&&this.j[b].Za(a)}Ac(a){return a in this.j?this.j[a]:null}};_.qd("dd",Vh);
}catch(e){_._DumpException(e)}
try{
var tj=document.querySelector(".gb_b .gb_e"),uj=document.querySelector("#gb.gb_Qc");tj&&!uj&&_.be(_.Rd,tj,"click");
}catch(e){_._DumpException(e)}
})(this.gbar_);
// Google Inc.
this.gbar_=this.gbar_||{};(function(_){var window=this;
try{
_.ge=function(a,b){return 0<=_.mb(a,b)};_.he=function(a){var b=typeof a;return"object"!=b?b:a?Array.isArray(a)?"array":b:"null"};_.ie=function(a){var b=_.he(a);return"array"==b||"object"==b&&"number"==typeof a.length};_.je=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}};try{(new self.OffscreenCanvas(0,0)).getContext("2d")}catch(a){}_.ke=_.A||_.tb;_.le=function(a,b){this.width=a;this.height=b};_.k=_.le.prototype;_.k.aspectRatio=function(){return this.width/this.height};_.k.lc=function(){return!(this.width*this.height)};_.k.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};_.k.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};_.k.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var ne,qe;_.me=function(a,b){return(b||document).getElementsByTagName(String(a))};_.oe=function(a,b){_.ab(b,function(c,d){c&&"object"==typeof c&&c.Xb&&(c=c.Hb());"style"==d?a.style.cssText=c:"class"==d?a.className=c:"for"==d?a.htmlFor=c:ne.hasOwnProperty(d)?a.setAttribute(ne[d],c):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,c):a[d]=c})};
ne={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};_.re=function(a,b){var c=b[1],d=_.pe(a,String(b[0]));c&&("string"===typeof c?d.className=c:Array.isArray(c)?d.className=c.join(" "):_.oe(d,c));2<b.length&&qe(a,d,b);return d};
qe=function(a,b,c){function d(h){h&&b.appendChild("string"===typeof h?a.createTextNode(h):h)}for(var e=2;e<c.length;e++){var f=c[e];if(!_.ie(f)||_.eb(f)&&0<f.nodeType)d(f);else{a:{if(f&&"number"==typeof f.length){if(_.eb(f)){var g="function"==typeof f.item||"string"==typeof f.item;break a}if("function"===typeof f){g="function"==typeof f.item;break a}}g=!1}_.nb(g?_.ma(f):f,d)}}};_.se=function(a){return _.pe(document,a)};
_.pe=function(a,b){b=String(b);"application/xhtml+xml"===a.contentType&&(b=b.toLowerCase());return a.createElement(b)};_.te=function(a){for(var b;b=a.firstChild;)a.removeChild(b)};_.ue=function(a){return _.eb(a)&&1==a.nodeType};_.ve=function(a){return 9==a.nodeType?a:a.ownerDocument||a.document};_.we=function(a,b)
  • "_the error... is too long to post on here_" - But you should post it anyway. The full stack trace could be extremely useful for troubleshooting. You can format the text of the stack trace, to make it more readable (e.g. surround it with triple-backticks at the start and end on lines of their own). See [How do I format my posts using Markdown or HTML?](https://stackoverflow.com/help/formatting). – andrewJames Feb 08 '23 at 22:19
  • If you are not familiar with how to use stack traces yourself (maybe you already are), then take a look at [What is a stack trace, and how can I use it to debug my application errors?](https://stackoverflow.com/q/3988788/12567365) – andrewJames Feb 08 '23 at 22:19
  • i added a majority of the stack trace. i wasn't able to add the whole thing by 1000 characters – Erasedsword Feb 09 '23 at 02:40
  • HTMLUnit's JavaScript engine is very limited and doesn't support all the features that most modern browsers do. You may want to try a library that remote controls a real browser instead, such as Selenium or Playwright. – RoToRa Feb 09 '23 at 08:10

0 Answers0