![](/img/trans.png)
[英]Extract only HTML tags and attributes from a html string using Jsoup
[英]Using JSoup to extract a string from within a string
我目前無法從字符串中提取字符串。 在以下示例中:
<a class="gb1" href="http://www.google.com/imghp?hl=en&tab=wi">Images</a>
我想通過“&amp”提取“ http”,但只知道如何提取一個。 字符串每次都會更改,因此我無法完全寫出該部分。 有任何想法嗎?
當您能夠通過String#substring()
提取內容時,為什么要使用完整的庫? 搜索鏈接的href
值的開頭,然后在下一個"
處停止以獲取href
內容,或者在href
部分之后遇到的第一個&
之后停止。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.