【发布时间】:2017-01-19 09:35:06
【问题描述】:
我的问题与 this one 相同,只是我有一个数组 (Document[]),而不是单个 Document。
我通常使用 R,而不是 Java,所以如果对于数组的情况如何从链接线程更改解决方案显而易见,我深表歉意。
单个Document 对象的解决方案是:
String htmlString = doc.html();
我创建对象的代码是:
Document[] target = new Document[20];
for(int n=0; n < strvec.length;n++){
target[n] = Jsoup.connect(strvec[n]).get();
}
我尝试了一些方法,例如将原始target 对象创建为String[],将.toString() 放在Jsoup.connect(strvec[n]).get() 的末尾以及其他地方,但这些尝试都没有成功。
【问题讨论】: