|
@@ -69,6 +69,7 @@ public class HbdtWxFecthServiceImpl implements HbdtFetchService {
|
|
|
}
|
|
|
|
|
|
private List<AirHbdt> fetch(int type) throws IOException, ParserException {
|
|
|
+ List<AirHbdt> hbdtList = new ArrayList<>();
|
|
|
String html = null;
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
try {
|
|
@@ -79,13 +80,15 @@ public class HbdtWxFecthServiceImpl implements HbdtFetchService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ if(null == html) {
|
|
|
+ return hbdtList;
|
|
|
+ }
|
|
|
Parser parser = new Parser();
|
|
|
parser.setResource(html);
|
|
|
FormFilter filter = new FormFilter();
|
|
|
parser.extractAllNodesThatMatch(filter);
|
|
|
Node pageNode = filter.getOptionNode();
|
|
|
NodeList options = pageNode.getChildren();
|
|
|
- List<AirHbdt> hbdtList = new ArrayList<>();
|
|
|
for (Node n : options.toNodeArray()) {
|
|
|
if (n instanceof Tag) {
|
|
|
Tag t = (Tag) n;
|