Kasi Tooneste GetElementByID Ro Tooye B4A Yad Begire?
Man Harchi Say Kardam Natoonestam !!!
Doostan Ye Hemmato Talashi Konan Age Chizi Peyda Kardan Tooye Hamin Topic Bezaran.
No user |
Sub Globals
Dim we As WebViewExtras
Private WebView1 As WebView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("ehem")
we.addJavascriptInterface(WebView1, "B4A")
we.addWebChromeClient(WebView1, "")
WebView1.LoadUrl("https://google.com")
End Sub
Sub WebView1_PageFinished (Url As String)
Dim Javascript As String
Javascript="B4A.CallSub('Process_HTML', false, document.documentElement.outerHTML)"
Log("PageFinished: "&Javascript)
we.executeJavascript(WebView1, Javascript)
End Sub
Sub Process_HTML(Html As String)
Log("Process_HTML: "&Html)
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
we.executeJavascript(WebView1,"document.getElementsByName('txtUserName')[0].value= '"&EditText1.Text&"';")
End Sub
Sub EditText2_TextChanged (Old As String, New As String)
we.executeJavascript(WebView1,"document.getElementsByName('txtPassword')[0].value= '"&EditText2.Text&"';")
End Sub
<input type="submit" name="LoginButton" value="ورود به سیستم" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("LoginButton", "", true, "Login1", "", false, false))" id="LoginButton" class="button" style="font-family:tahoma;font-size:10px;height:23px;width:132px;" />
we.addJavascriptInterface(WebView1, "B4A")
we.addWebChromeClient(WebView1, "")
Dim Javascript As String
Javascript="B4A.CallSub('Process_HTML', false, document.documentElement.outerHTML)"
we.executeJavascript(WebView1, Javascript)
Sub Process_HTML(Html As String)
Log("Process_HTML: "&Html)
End Sub
we.executeJavascript(WebView1,"if (document.getElementsByName('LoginButton')[0].value == 'ورود به سیستم') {document.forms.form2.submit();}")
imanking wrote:Be nazare man harbar ke site load shod load html kon bad bego ke az inja http://212.95.150.40/CaptchaImage.guid ta folan jaro bgir
bad ye soal chetor mishe matno be php ferestad?
Sub Globals
Dim WebView1 As WebView
Dim m As WebViewExtras
Dim mm As WebViewExtras
Dim Javascript As StringBuilder
Dim Javascript2 As StringBuilder
Dim submit As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebView1.Initialize("webview1")
submit.Initialize("submit")
Activity.AddView(WebView1,0,0,100%x,100%y)
Activity.AddView(submit,10,85%y,100,50)
submit.Text="Submit"
Javascript2.Initialize
Javascript.Initialize
WebView1.LoadUrl("http://212.95.150.40/login.aspx")
End Sub
Sub WebView1_PageFinished (Url As String)
Javascript.Append("document.forms.form2.txtUserName.value='shomare daneshjoyi';")
Javascript.Append("document.forms.form2.txtPassword.value='password';")
m.executeJavascript(WebView1, Javascript.ToString)
End Sub
Sub Process_Globals
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub submit_Click
Javascript2.Append("document.forms.form2.submit()")
mm.executeJavascript(WebView1, Javascript2.ToString)
End Sub]
Dim m As String = "linke captcha"
Dim mb As String = m.Substring(22)
Dim wv as webview
wv.loadurl("http://212.95.150.40/CaptchaImage.axd?guid=&mb&")
|
|