How to get one “a href” out of many in one html class with jSoup

前端 未结 2 1515
独厮守ぢ
独厮守ぢ 2021-01-26 15:47

I have to extract all text elements in HTML into Java Strings. But in seperate Strings.

I have the following code:

相关标签:
2条回答
  • 2021-01-26 16:13

    Code Snippet for example

    Document abc = Jsoup.connect("http://www.abc.in/").timeout(0).get();
    Elements ee = abc.select("a[href*=xyz]");// all hrefs containing xyz substring 
    String xyz = ee.first().attr("abs:href");
    
    0 讨论(0)
  • 2021-01-26 16:15

    "Elements myText = doc.getElementsByClass(x);"

    Look @ the CSS of the webpage in question, find the class id of the css element assigned to the element in question.

    0 讨论(0)
提交回复
热议问题