1
我想過濾groovy中的url內容,但絕不會在google中找到任何指南或使用示例,因此非常感謝所有幫助。如何篩選Groovy中的url文本
什麼是我想要做的是
<table class="smthng">
標籤中獲取的信息在以下網址
def resultText = "http://weather.am".toURL().text
我迄今試圖是要找到那麼所需的起跑線處理每直到達到結束標記,但我非常確定Groovy應該有很好的處理它的東西。例如,在groovy中,我可以使用find閉包來查找只有起始標籤,例如
if(it =~ "desired starting tag){
then keep the value in list
}
但我不知道如何做到這一點在整個表格塊在groovy優雅的方式。我聽說過第三方庫,如dom4j,nekohtml等,但我確信Groovy本身可以處理這個問題。在此先感謝
很漂亮,謝謝。 – Edgar