VBA login into website

malortje

New Member
Joined
May 28, 2019
Messages
4
Hi Guys,


Tried a lot but I can't figure out how to login on this website.
Could someone please help me out ?


I want to scrape some data from a website but I couldn't even login with VBA code because it's keep saying "Object doens't support this property or Method" with this code:


Code:
Sub GetPrintStats()
Set IE = CreateObject("InternetExplorer.application")
Set IE = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
 
With IE
.Visible = True
.navigate ("http://10.209.58.26/?MAIN=LOGIN")
End With
While IE.Busy: DoEvents: Wend


Set doc = IE.document


doc.getElementsByTagName("input")(0).Value = "xx"
 
End Sub


Or with these code I got : "Object variable or With block variable not set"
Code:
Sub GetPrintStats()
Set IE = CreateObject("InternetExplorer.application")
Set IE = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
 
With IE
.Visible = True
.navigate ("http://10.209.58.26/?MAIN=LOGIN")
End With
While IE.Busy: DoEvents: Wend


Set doc = IE.document


doc.getElementById("USERNAME").Value = "xx"


End Sub
bXdK0Kz

bXdK0Kz
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
sorry above is the HTML code that is from the website where I want to login. But I can't insert pictures here :(
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,411
Members
448,894
Latest member
spenstar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top