HTML code getter using SWT Browser
问题 How I can get html-page code to String using SWT Broser? Display display = new Display(); Shell shell = new Shell(display); shell.setSize(100, 100); Browser browser = new Browser(shell, SWT.NONE); browser.setBounds(5, 75, 100, 100); shell.open(); browser.setUrl("https://google.com"); String html = browser.getText(); //NOTHING! while (!shell.isDisposed()) { if (!display.readAndDispatch() && html == null) { display.sleep(); } } display.dispose(); Syste.out.println(html); ////NOTHING! So, how I