本文整理了Java中org.eclipse.swt.browser.Browser.getText()
方法的一些代码示例,展示了Browser.getText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Browser.getText()
方法的具体详情如下:
包路径:org.eclipse.swt.browser.Browser
类名称:Browser
方法名:getText
[英]Returns a string with HTML that represents the content of the current page.
[中]返回一个包含HTML的字符串,该字符串表示当前页面的内容。
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Disposes the "Example" widgets.
*/
@Override
void disposeExampleWidgets () {
/* store the state of the Browser if applicable */
if (browser != null) {
String url = browser.getUrl();
if (url.length() > 0 && !url.equals("about:blank")) { //$NON-NLS-1$
lastUrl = url;
} else {
String text = browser.getText();
if (text.length() > 0) {
lastText = text;
}
}
}
super.disposeExampleWidgets();
}
代码示例来源:origin: openaudible/openaudible
private HtmlPage getHtmlPage() {
try {
String html = this.browser.browser.getText();
final List<NameValuePair> responseHeaders = new ArrayList<>();
String u = browser.browser.getUrl();
URL url = new URL(u);
WebRequest request = new WebRequest(url);
WebResponseData webResponseData = new WebResponseData(html.getBytes(), 200, "OK", responseHeaders);
WebResponse webResponse = new WebResponse(webResponseData, request, 0);
WebWindow w = this.getCurrentWindow();
HtmlPage p = HTMLParser.parseHtml(webResponse, w);
p.initialize();
// String title = p.getTitleText();
if (u.toLowerCase().contains("audible"))
lastPage = p;
// logger.info("xml=" + p.asXml());
return p;
} catch (Throwable th) {
th.printStackTrace();
}
return null;
}
代码示例来源:origin: stackoverflow.com
browser.addProgressListener(new ProgressListener() {
public void completed(ProgressEvent event) {
System.out.println(browser.getText());
shell.close();
内容来源于网络,如有侵权,请联系作者删除!