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

前端 未结 2 1533
独厮守ぢ
独厮守ぢ 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");
    

提交回复
热议问题