|
-
Jan 3rd, 2011, 07:42 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Login to a webpage
Hello im a bit new with vb programming
i was wondering how i can login to a webpage with a button that has no id just a name
Code:
<button name="loginBtn" type="submit" class="glue primary">Login</button></p>
<div id="SMSVerifyObj"></div>
</fieldset>
</form>
<iframe id="loginIframe" name="loginIframe"></iframe>
heres what i have so far it adds my email and name to the webpage just need to make it click the login button on the page
Code:
Form1.WebBrowser1.Document.All("emailSplash").Value = "myemail"
Form1.WebBrowser1.Document.All("passwordSplash").Value = "mypassword"
this the name of the button not working any ideas?
Form1.WebBrowser1.Document.All("loginBtn").submit
-
Jan 3rd, 2011, 10:23 PM
#2
Re: Login to a webpage
Can you post the weblink?
Sid
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jan 4th, 2011, 05:51 AM
#3
Re: Login to a webpage
you click the button or submit the form
try
Form1.WebBrowser1.Document.All("loginBtn").click
or find the form name (not form1) or index to submit it
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jan 4th, 2011, 08:10 AM
#4
Fanatic Member
Re: Login to a webpage
could you please give a link to the site, or the whole form code?
-
Jan 4th, 2011, 10:04 AM
#5
Thread Starter
Addicted Member
Re: Login to a new myspace
 Originally Posted by Justa Lol
could you please give a link to the site, or the whole form code?
it the new myspace update login
got the code working heres the code for clicking a button with no id
Code:
If Form1.WebBrowser1.ReadyState = WebBrowserReadyState.complete Then
Form1.WebBrowser1.Document.All("emailSplash").Value = Email.Text
Form1.WebBrowser1.Document.All("passwordSplash").Value = Password.Text
Dim oCol As IHTMLElementCollection
Set oCol = Form1.WebBrowser1.Document.All.tags("BUTTON")
For Each oelement In oCol
If InStr(oelement.className, "glue primary") > 0 Then
oelement.Click
End If
Next oelement
End If
-
Jan 4th, 2011, 10:45 AM
#6
Fanatic Member
Re: Login to a webpage
sorry, i ment the login form, anyways, if your problem has been solved, please mark thread as resolved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|