爬取新闻数据测试

This commit is contained in:
dengli
2023-12-19 20:17:24 +08:00
parent b118551f9b
commit fde0e2f8c7

View File

@@ -278,8 +278,7 @@ public class StockService {
.header("Referer", "https://www.business-standard.com/")
.header("Accept-Language", "en-US,en;q=0.9")
.get();
//result = doc.html().substring(doc.html().indexOf("articleBody") + 15,doc.html().indexOf("author") - 5);
result = doc.html();
result = doc.html().substring(doc.html().indexOf("articleBody") + 15, doc.html().indexOf(",\"author\":") - 1);
} catch (Exception e) {
return e.toString();
}