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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,591
Messages
6,120,425
Members
448,961
Latest member
nzskater

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