綁定帳號登入

Android 台灣中文網

打印 上一主題 下一主題

[求助] android parse html (jsoup)問題

[複製連結] 查看: 1013|回覆: 5|好評: 0
跳轉到指定樓層
樓主
Leung-Jacky | 收聽TA | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
發表於 2016-5-23 13:32
200碎鑽
本帖最後由 Leung-Jacky 於 2016-5-23 13:44 編輯

請問如何在以下例子中取出目標

解答請付上代碼!!
目標:[["params","..."],["...","..."],["...","..."],["...","..."],["...","..."],["...","..."],["...","..."]]
"..."等於會變的String不能作為搜尋
response:
  1. <!DOCTYPE html>
  2. <html>
  3. <header>
  4. <...>...</...>
  5. </header>
  6. <body>
  7. <h1></h1>
  8. <script>
  9. ...
  10. </script>
  11. <script>
  12. ...
  13. </script>
  14. <script>
  15. ...
  16. </script>
  17. <script>
  18. ...
  19. </script>
  20. <script>
  21. ...
  22. </script>
  23. <script>
  24. ...
  25. </script>
  26. <script>
  27. ...
  28. 目標在此
  29. ...
  30. </script>
  31. <script>
  32. ...
  33. </script>
  34. </html>
複製代碼









最佳答案

查看完整內容

這個有點複雜,哈。 建議你用正規表示式去捉吧。
「用Android 就來APK.TW」,快來加入粉絲吧!
Android 台灣中文網(APK.TW)
收藏收藏 分享分享 分享專題
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

沙發
ploglin | 收聽TA | 只看該作者
發表於 2016-5-23 13:32
這個有點複雜,哈。
建議你用正規表示式去捉吧。
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

板凳
ploglin | 收聽TA | 只看該作者
發表於 2016-5-23 14:03
你直接把你要捉的網頁網址po上來可能比較準確
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

地板
 樓主| Leung-Jacky | 收聽TA | 只看該作者
發表於 2016-5-23 14:31
ploglin 發表於 2016-5-23 14:03
你直接把你要捉的網頁網址po上來可能比較準確

https://www.facebook.com/video/embed?video_id=1083145455091471


embed link 來的...
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

5
 樓主| Leung-Jacky | 收聽TA | 只看該作者
發表於 2016-5-23 14:31
ploglin 發表於 2016-5-23 14:03
你直接把你要捉的網頁網址po上來可能比較準確

https://www.facebook.com/video/embed?video_id=1083145455091471


embed link 來的...
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

6
 樓主| Leung-Jacky | 收聽TA | 只看該作者
發表於 2016-5-24 20:17
ploglin 發表於 2016-5-24 18:11
這個有點複雜,哈。
建議你用正規表示式去捉吧。

自行解決了,但謝謝
用Android 就來Android 台灣中文網(https://apk.tw)
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則