We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example Code. Screenshot.
class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val webView = findViewById<WebView>(R.id.webView) webView?.let { it.settings.javaScriptEnabled = true it.webViewClient = MyWebViewClient() } webView.loadUrl("https://en.wikipedia.org/wiki/The_New_York_Times") } class MyWebViewClient(): WebViewClient() { override fun onPageFinished(view: WebView?, url: String?) { super.onPageFinished(view, url) view!!.evaluateJavascript("javascript:encodeURI(document.documentElement.outerHTML);") { if(!it.isNullOrEmpty()){ val txt = URLDecoder.decode(it, "UTF-8") val read = Readability4J(url!!, URLDecoder.decode(it, "UTF-8")) val t1 = read.parse().textContent val t2 = read.parse().textContent val t3 = read.parse().textContent val t4 = read.parse().textContent val t5 = read.parse().articleContent!!.text() val t6 = read.parse().articleContent!!.text() Log.d("DBG", "loaded") } } } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example Code.
Screenshot.
The text was updated successfully, but these errors were encountered: