Sure, what I want to do is display an Instagram page in WebView , and then access the code of that page with JavaScript, and use the "document.getElementByClassName" and Give the name of the class in which the caption text is located, receive that text and display it in the edittext. But after entering the link and hitting the download button, I will receive the following errors.
ErrorUtils caught an error:
followedByViewer state must be defined
Subsequent non-fatal errors won't be logged; see
https://fburl.com/debugjs. in
https://www.instagram.com/static/bundles/es6/ConsumerLibCommons.js/4f9d3a21f3b5.js (Line: 4)
Uncaught SyntaxError: missing ) after argument list in ..... (Line: 1)
Uncaught TypeError: Cannot read property 'push' of undefined in ..... (Line: 53)
I will put the code of the relevant section below.
if u want i can attach files so u can run it and see how its work
Sub WebView1_PageFinished (Url As String)
Dim javascript As String
WebView1.JavaScriptEnabled = True
javascript = "web.CallSub('cap', false, javascript: document.getElementsByClassName('C4VMK')[0].innerText)"
w.executeJavascript(WebView1,javascript)
End Sub
Public Sub cap (ca As String)
textcaption.Text=ca.Trim
ProgressDialogHide
End Sub
Public Sub download_Click
w.addJavascriptInterface(WebView1,"web")
w.addWebChromeClient(WebView1,"")
WebView1.LoadUrl(""&edlink.Text)
ProgressDialogShow("copying...")
End Sub