Menu

#1953 "SEVERE" Error when loading twitter homepage

2.29
accepted
RBRi
None
1
2019-05-09
2018-02-25
arya
No

There is an error which prevents any interactions to the page. Here is the relavant code for logging into twitter.com

try {
    WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED);
    webClient.getOptions().setThrowExceptionOnScriptError(false);


    HtmlPage page = webClient.getPage("http://twitter.com");

    ((HtmlElement) page.getFirstByXPath("//input[@name='session[username_or_email]']"))
            .type("myusername");

    ((HtmlElement) page.getFirstByXPath("//input[@name='session[password]']")).type("mypass");

    HtmlPage loggedinPage = ((DomElement) page.getFirstByXPath("//input[@value='Log in']")).click();

    System.out.println("Clicked login!");

    String pageAsXml = loggedinPage.asXml();

    System.out.println(pageAsXml);
} catch (Exception e) {
    e.printStackTrace();
}
SEVERE: runtimeError: message=[An invalid or illegal selector was specified (selector: '*,:x' error: Invalid selector: :x).] sourceName=[https://abs.twimg.com/k/en/init.en.be4b65b57fb553170565.js] line=[12] lineSource=[null] lineOffset=[0]
Feb 24, 2018 9:36:21 PM com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl runSingleJob
SEVERE: Job run failed with unexpected RuntimeException: null
java.lang.IllegalStateException
    at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getTopCallScope(ScriptRuntime.java:3394)
    at net.sourceforge.htmlunit.corejs.javascript.BoundFunction.call(BoundFunction.java:52)
    at com.gargoylesoftware.htmlunit.javascript.host.Promise$3.run(Promise.java:380)
    at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:424)
    at com.gargoylesoftware.htmlunit.javascript.background.DefaultJavaScriptExecutor.run(DefaultJavaScriptExecutor.java:155)
    at java.lang.Thread.run(Thread.java:748)

Discussion

  • RBRi

    RBRi - 2018-02-27
    • assigned_to: RBRi
     
  • RBRi

    RBRi - 2018-02-27

    Do you use the latest snapshot? If not can you please try with the snapshot build.
    Is this the whole stack trace output?

     
  • RBRi

    RBRi - 2018-06-30

    Looks like i can reproduce this here also. Will have a look but it requires some time because this is a problem deep inside the machine.

     
  • RBRi

    RBRi - 2018-06-30
    • status: open --> accepted
     
  • RBRi

    RBRi - 2019-05-09

    The exception is now fixed. Will provide a new snapshot. But it looks like the login does still not work.

     

Log in to post a comment.

MongoDB Logo MongoDB