Hack Forums
[.NET] Visual Studio Browser Window Not Clicking And Inputting - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Visual Studio Browser Window Not Clicking And Inputting (/showthread.php?tid=5636521)



Visual Studio Browser Window Not Clicking And Inputting - MMCraftin - May 31, 2017

Can Someone Help Me Fix This Code

The Webpage The I Am Trying To Do This On Is The Google Sign In Page

My Code:

WebBrowser1.Navigate("google link but hackforums wouldn't let me put here")
Try
Dim str() As String = Split(ListBox1.SelectedItem.ToString(), ":")
WebBrowser1.Document.GetElementById("Email").SetAttribute("value", str(0))
WebBrowser1.Document.GetElementById("Passwd").SetAttribute("value", str(1))
WebBrowser1.Navigate("javascript:document.forms[1].submit();void(0);")
ListView3.Items.Add(TimeOfDay & " >> " & "Signing in with " & str(0))
ListView3.Items.Add("Current User >> " + str(0))
Catch ex As Exception
End Try
End Sub

The Email Sometimes Doesn't Get Put In And Clicking Of Submit Doesn't Work Entirely. If I Put In Email Manually And Click Next Password Goes In But Once Again Submit Doesn't Work


* - log dot zip - May 31, 2017

1. You're almost 100% certainly automating this in a very hacky fashion. The only excuse for what you're doing is dealing with highly JS-reliant pages where a browser would save you a lot of time.
2. Are you ensuring that the document has loaded?
3. You're giving us no context as to what this site is. You can't just say your code doesn't work and ask us to fix it for you without atleast supplying the bare minimum details.


* - Kink - May 31, 2017

If the issue is Rabite's first point(JS-heavy site), you should attempt to set focus to the webbrowser before setting the attribute values (try both documentcompleted and before your above code), my guess is it's unfocused and you're setting the values without focus and the site's script is unaware of it even happening.


* - MMCraftin - Jun 1, 2017

Kink I Tried What You Said But It Stays On Email Page And Doesn't Go To Password Still


Coven Do You Have Any Suggestions Besides geckofx Because It Is For C# When I Am Coding In Visual Studio Code


* - Barret - Jun 1, 2017

Where the fk is my reply??? O_O i sworn i posted one.