Java:使用JSoup提取其中包含某个单词的所有链接?
可能是一个不清楚的问题,下面是代码和说明:Java:使用JSoup提取其中包含某个单词的所有链接?,java,html,parsing,jsoup,Java,Html,Parsing,Jsoup,可能是一个不清楚的问题,下面是代码和说明: Document doc = Jsoup.parse(exampleHtmlData); Elements certainLinks = doc.select("a[href=google.com/example/]"); 字符串exampleThmlData包含来自特定站点的已解析HTML源。这个网站有很多链接可以将用户直接链接到谷歌。例如: http://google.com/example/hello http://goog
Document doc = Jsoup.parse(exampleHtmlData);
Elements certainLinks = doc.select("a[href=google.com/example/]");
字符串exampleThmlData包含来自特定站点的已解析HTML源。这个网站有很多链接可以将用户直接链接到谷歌。例如:
http://google.com/example/hello
http://google.com/example/certaindir/anotherdir/something
http://google.com/anotherexample
我想使用doc.select函数提取链接中包含google.com/example/的所有链接。如何使用JSoup实现这一点 您可以参考
非常感谢你的好意,先生,你救了我的命:)
Document doc = Jsoup.parse(exampleHtmlData);
Elements certainLinks = doc.select("a[href*=google.com/example/]");