新闻定时任务测试

This commit is contained in:
dengli
2024-02-08 19:59:23 +08:00
parent 4874e3bee4
commit 0112687ce2
2 changed files with 25 additions and 24 deletions

View File

@@ -115,7 +115,7 @@ public class InvestingTask {
newsList.forEach( n -> {
String contentUrl = n.substring(1, n.indexOf("class=\"img-smllnews\"") - 2);
String id = contentUrl.substring(contentUrl.lastIndexOf("-") + 1, contentUrl.lastIndexOf("_"));
String imgUrl = n.substring(n.indexOf("img src=") + 9, n.indexOf("?"));
String imgUrl = n.substring(n.indexOf("img loading=\"lazy\" src=") + 24, n.indexOf("?"));
String time = n.substring(n.indexOf("Last Updated") + 23, n.indexOf("IST") - 9);
SiteNews siteNews = new SiteNews();