I have a problem when I recover a text string, it recovers fine but it has some HTML tags and characters that I don't want to show, for example, from the following text I only want to recover the link that is between the href, but I don't know how I can extract that fragment or how remove everything I don't need, I don't know if it is possible for android to interpret the HTML tags.
This is an example of how it returns the text strings, I just want to keep the link:
<div><a
href=\"https://sitioWeb.org.mx/wp-content/uploads/2018/06/documento.pdf\"
class=\"pdfemb-viewer\" style=\"\" data-width=\"max\"
You can use this method which applies to get the value of any html tag:
In this case, according to the information you provide, if you want to obtain the value of the url defined in the tag
href
, you would do it this way:In the name of the site I see that you are working with Java, if this is the case you can use the replaceAll method, to eliminate all the \ it should be noted that these are added to be able to escape the double quotes.
result