|
@@ -25,6 +25,7 @@ import org.jfree.data.xy.DefaultXYDataset;
|
|
import org.jfree.data.xy.XYSeries;
|
|
import org.jfree.data.xy.XYSeries;
|
|
import org.jfree.data.xy.XYSeriesCollection;
|
|
import org.jfree.data.xy.XYSeriesCollection;
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.Jsoup;
|
|
|
|
+import org.jsoup.nodes.Document;
|
|
import org.springblade.core.tool.utils.CollectionUtil;
|
|
import org.springblade.core.tool.utils.CollectionUtil;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.IoUtil;
|
|
import org.springblade.core.tool.utils.IoUtil;
|
|
@@ -559,12 +560,15 @@ public class FormulaUtils {
|
|
public static Map<String, String> getElementCell(String uri) {
|
|
public static Map<String, String> getElementCell(String uri) {
|
|
try {
|
|
try {
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(uri);
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(uri);
|
|
- Map<String,String> result= Jsoup.parse(IoUtil.readToString(inputStreamByUrl))
|
|
|
|
|
|
+ Document document=Jsoup.parse(IoUtil.readToString(inputStreamByUrl));
|
|
|
|
+ Map<String,String> result= document
|
|
.select("table").first()
|
|
.select("table").first()
|
|
- .select("tr").stream()
|
|
|
|
- .flatMap(tr -> tr.select("td").stream())
|
|
|
|
- .filter(d -> !d.children().isEmpty())
|
|
|
|
- .map(d -> d.children().get(0)).map(d -> d.attr("keyname")).filter(StringUtils::isNotEmpty).map(e -> e.split("__"))
|
|
|
|
|
|
+ .select("el-input[keyname]").stream()
|
|
|
|
+// .select("tr").stream()有缺漏的情况
|
|
|
|
+// .flatMap(tr -> tr.select("td").stream())
|
|
|
|
+// .filter(d -> !d.children().isEmpty())
|
|
|
|
+// .map(d -> d.children().get(0))
|
|
|
|
+ .map(d -> d.attr("keyname")).filter(StringUtils::isNotEmpty).map(e -> e.split("__"))
|
|
.collect(
|
|
.collect(
|
|
Collectors.toMap(
|
|
Collectors.toMap(
|
|
b -> b[0],
|
|
b -> b[0],
|
|
@@ -585,7 +589,7 @@ public class FormulaUtils {
|
|
}
|
|
}
|
|
|
|
|
|
/* public static void main(String[] args) {
|
|
/* public static void main(String[] args) {
|
|
- Map<String,String> map=getElementCell("/www/wwwroot/Users/hongchuangyanfa/Desktop/privateUrl/1645328487982039040.html");
|
|
|
|
|
|
+ Map<String,String> map=getElementCell("/www/wwwroot/Users/hongchuangyanfa/Desktop/privateUrl/1645670856300429312.html");
|
|
System.out.println();
|
|
System.out.println();
|
|
}*/
|
|
}*/
|
|
/**
|
|
/**
|