爬取新股数据测试
This commit is contained in:
@@ -262,12 +262,7 @@ public class StockService {
|
||||
.header("Referer", "https://www.business-standard.com/")
|
||||
.header("Accept-Language", "en-US,en;q=0.9")
|
||||
.get();
|
||||
// 使用选择器提取所需的数据
|
||||
Elements newsHeadlines = doc.select(".article-listing");
|
||||
// 遍历提取到的数据并输出
|
||||
for (Element headline : newsHeadlines) {
|
||||
System.out.println(headline.text());
|
||||
}
|
||||
result = doc.html();
|
||||
} catch (Exception e) {
|
||||
return ServerResponse.createByErrorMsg(e.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user