I have String value that is txt (not html) that contains urls:
Blabla http://www.example.com/foo1/ blabla http://www.example.com/foo2/ blabla...
I need to grab all these urls from the string using Jsoup.
Is it possible?
I have String value that is txt (not html) that contains urls:
Blabla http://www.example.com/foo1/ blabla http://www.example.com/foo2/ blabla...
I need to grab all these urls from the string using Jsoup.
Is it possible?
No, Jsoup won't do this for you. Jsoup parses HTML tags, not arbitrary strings.
If you had an HTML document containing a bunch of link tags (<a href="http://example.com/page.html>link text</a>
), you could use Jsoup to parse the tags and extract the href
attribute.
If you just have a string with some links, you probably want to use regular expressions, as suggested in a comment by PeterMmm.