Created
October 18, 2021 15:06
-
-
Save wheeliechamp/fedc5bc5237fe8347078fc6fd40983ab to your computer and use it in GitHub Desktop.
解析用メソッド追加
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.webscrapingtest.viewmodel | |
import android.util.Log | |
import androidx.lifecycle.ViewModel | |
import org.jsoup.Jsoup | |
import org.jsoup.nodes.Document | |
import org.jsoup.select.Elements | |
class MainViewModel : ViewModel() { | |
// TODO: Implement the ViewModel | |
fun analyzeHtml(src: String) { | |
var document: Document = Jsoup.parse(src) | |
var elements: Elements = document.getElementsByClass("LifeToolLocalWeatherItem__body") | |
Log.d("Test", elements.text()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment