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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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