【问题标题】:JSoup not sees table on web pageJSoup 在网页上看不到表格
【发布时间】:2020-05-24 13:53:02
【问题描述】:

我想从网页中获取表格:

<table class="coupon-row-item coupone-labels">...</table>

我用

Element market = page.select("table[class=coupon-row-item coupone-labels").first();

然后得到

线程“主”org.jsoup.select.Selector$SelectorParseException 中的异常:在“class=coupon-row-item coupone-labels”处未找到平衡标记

功能齐全

protected void getMainMarked(ArrayList<String> arrLinks) throws IOException {
    Document page = Jsoup.parse(new URL(arrLinks.get(0)), 5000);
    Element market = page.select("table[class=coupon-row-item coupone-labels").first();
}

【问题讨论】:

    标签: java parsing html-parsing html-parser javaparser


    【解决方案1】:

    我想尝试以下选择器语法(如Jsoup documentation 中所述):

    Element el = doc.select("table.coupon-row-item.coupone-labels").first();
    

    【讨论】:

      猜你喜欢
      • 2021-01-24
      • 2021-06-02
      • 1970-01-01
      • 2017-03-19
      • 1970-01-01
      • 1970-01-01
      • 2014-03-23
      • 1970-01-01
      • 2013-01-02
      相关资源
      最近更新 更多