【发布时间】:2013-02-01 04:38:55
【问题描述】:
我把代码写成
String sourceUrlString="http://some url";
Source source=new Source(new URL(sourceUrlString));
Element INFORM = source.getElementById("main").getAllElementsByClass("game").get(i-1);
String INFORM = INFORM.replaceAll("\\s",""); //shows error here
sendResponse(resp,+INFORM);
现在我想要 text 从 Element INFORM 获取是忽略空白我该怎么做?上面提到String INFORM显示错误重复的局部变量INFORM);
例如
Element INFORM 获取的文本是“我的名字是 satish” 但它必须发送响应为
“我的名字”
【问题讨论】:
标签: java html jsp jakarta-ee html-parsing