-1

Trying to collect data via a web socket when hitting NullPointerException.

public static void main(String[] args) throws IOException, InterruptedException {
  String s = "https://www.tradingview.com/chat/#bitcoin";
  URL url = new URL(s);

  WebDriver driver = new HtmlUnitDriver(true);
  driver.get(s);
  System.out.println(driver);
}

nov 30, 2017 8:36:46 PM 
com.gargoylesoftware.htmlunit.javascript.host.WebSocket <init>
GRAVE: WebSocket Error: 'url' parameter 
'wss://data.tradingview.com/socket.io/websocket' is invalid.
java.lang.NullPointerException: domNode
Darrell Teague
  • 4,132
  • 1
  • 26
  • 38
Veronica
  • 1
  • 1
  • No this is not an ordinaly NPE question. This points to a programming problem inside the HtmlUnit library. – RBRi Dec 03 '17 at 08:48
  • In the question/answer spirit of the site... one has to ask specific questions, to which, showing the stack-trace of the NPE would have exposed _where_ it occurs... which would then lead to solving the problem - which ultimately doesn't work as a question/answer pair in this forum and thus the resolution to close the question as a duplicate (if not non-sequitur) is appropriate. – Darrell Teague Dec 04 '17 at 18:12

1 Answers1

0

I can reproduce your problem. Please open an HtmlUnit issue and i will try to fix this.

RBRi
  • 2,704
  • 2
  • 11
  • 14
  • Thanks for your answer! I don't know how it works but this is my GitHub repository https://github.com/veronicanovelli95/provaTesi – Veronica Dec 01 '17 at 10:51
  • Veronica, you are using software written by other in there spare time and available for you for free. I think you should be able to google for the HtmlUnit home page. There is some description about bug reporting and filling a ticket is simple. I think that is not too much effort. – RBRi Dec 02 '17 at 18:24