Search code examples
javaparsinghtml-parsinghtml-parserjavaparser

JSoup not sees table on web page


I want to get a table from a web page:

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

I use

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

And get

Exception in thread "main" org.jsoup.select.Selector$SelectorParseException: Did not find balanced marker at 'class=coupon-row-item coupone-labels'

Full function

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();
}

Solution

  • I suppose to try following selector syntax (as described in Jsoup documentation):

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