【发布时间】:2021-03-30 10:22:44
【问题描述】:
我正在使用 JSOUP 学习网络 scraping,我一直在尝试检索类标签 sc-fzqBZW sc-fzoyAV eGbWXV 的数据。我尝试用点替换空格,但似乎没有任何效果。我在下面附上代码块。如果有人指出我的错误并为我纠正,我将非常感激。
这是行:
"
需要accountId"
public static void main(String[] args) throws Exception {
System.out.println("Loading Scraper!");
final String url = "https://apidocs.temenos.com/service/account-management#operation/getAccountClosure";
Document doc;
try {
doc = Jsoup.connect(url).get();
String title = doc.title();
System.out.println("Title: " + title);
org.jsoup.select.Elements elements = doc.select("sc-fzqBZW.sc-fzoyAV.eGbWXV");
//original class tag = sc-fzqBZW sc-fzoyAV eGbWXV
for (Element element : elements) {
System.out.println("Ticker:" + element.text());
}
} catch (Exception ex) {
System.out.println("Error in establising connection. /n" + "Error: " + ex);
}
}
【问题讨论】:
-
仅供参考,它是 scrape(和 scrape、scraped、scraper)不是报废
标签: java web-scraping jsoup