VBScript Basics, Part 13 | Internet Explorer - HTML (Automation)

preview_player
Показать описание
VBScripting (.vbs) Basic tutorial on how to directly input values into internet explorer through html code. This makes for a more flawless and smooth process rather than using sendkeys.

Code Example:
______________________________________________________

Option Explicit
Dim ie, ipf

Set ie = CreateObject("InternetExplorer.Application")

On Error Resume Next

Sub WaitForLoad
Do While IE.Busy
WScript.Sleep 500
Loop
End Sub

Sub Find(x)
Set ipf = ie.Document.All.Item(x)
End Sub

ie.Left = 0
ie.Top = 0
ie.Toolbar = 0
ie.StatusBar = 0
ie.Height = 120
ie.Width = 1020
ie.Resizable = 0

Call WaitForLoad

ie.Visible = True

Call Find("email")
ipf.Value = "EMAIL GOES HERE"
Call Find("pass")
ipf.Value = "PASSWORD GOES HERE"
Call Find("login_form")
ipf.Submit

Call WaitForLoad
ie.Height = 700
______________________________________________________

Know the Basics:
------------------------------------------------------------------------------------------
Set ie = CreateObject("InternetExplorer.Application")

ie.Document.All.Item("INPUT ID").Value = "what you want"
ie.Document.All.Item("FORM ID).Submit
------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

Great tutorial videos, you have given me great ideas to resolve my coding issue, thank you keep up this great series.

joegonzo
Автор

Yes.
Because I'm always inventing something. He helps me a lot

fJonatas
Автор

Yes, precisely. When your web-browser is already logged in to a website, then when you open it up it will not go to the log in page and this will cause and error because the page the vbscript is trying to go to doesn't exist. So by ignoring the part that is already complete, it actually does fix the problem. But you are correct it doesn't actually fix the problem, I should have worded that differently in the tutorial.

SimplyCoded
Автор

*+Blue Squirel* Try this:
Option Explicit
Dim Speech : Set Speech = CreateObject("sapi.spvoice")
Dim a, b, c
a=inputbox("what do you want to say?") 
b=inputbox("how many times do you want to say it?") 
If IsNumeric(b) then
For c = 1 To b
Speech.Speak a
Next
Else
WScript.Quit
End If

SimplyCoded
Автор

Appreciate the suggestion though man. Notepad++ is a good editor to have.

SimplyCoded
Автор

Sure.. will wait for that. Thanks for clarification:)

yogeshkancherla
Автор

I really liked the way you are explaining..it creates more interest. Thanks jeremy for posting such important and useful videos. I have few queries now...
you got object id's from html code and used it but what if the page has multiple objects with same properties..how to identify those and use??? Another question is how will it work when two instances of ie browser is open?

yogeshkancherla
Автор

Tried to find a tutorial for this on batch, but it’s awesome too

TheFantasticWarrior
Автор

I am trying to use this code and I keep getting a message from Edge that I should be using it and none of the ie.Document.All.Item() code in the IE window is doing anything. I cannot get the code to populate the elements to work in this lesson. I see you answered a persons question a week ago. I also see that IE 11 will be discontinued July 2022. Hope you can shed some insight just in case I am being weird. The error I am getting is the same as the error you displayed when a person is already signed in, but I have not signed in yet. Thanks in advance. Great videos. Am almost finished with the HTA videos. Working through the VBScript videos and plan to look at JavaScript. Thanks for taking the time to help us!!!

scottmartens
Автор

Hello, I want to ask a question: Can I do this in some other browser? (like Mozilla Firefox)

ImdamacikLyrics
Автор

Internet automation is absolutely amazing! I really appreciate what you are doing on this channel. This video has set me on a path to fully automate a lot of my work online, which brings me to the below issue. How do I go about downloading a file from a URL? I have tried using ADO stream, but it throws an error about mismatch arguments during the write process. Also looked for anything about "right mouse click" but no forums direct me into how to code that. Would you know how to do this or point me into a direction that might have this solution? I have practically lived on Stack Overflow for the past week looking into this issue.

bobzumacke
Автор

Hi. I have to use a href component to go to my next web page, and the href component in the code is <a href=javascript: to handle this? can you please help me.

AbdulAbdul-ydhw
Автор

In the example code shown in description:

Option Explicit
and
On Error Resume Next
both are used.

So will Option Explicit do any work here? Or will it be overridden by 2nd command?

saraagarwal
Автор

I want to ask, does this code work if its not visible? (ie.visible=0)

rednexie
Автор

I am downloading an excel and I always get SAVE dialog in IE. How to control the dialog and the save the file using VBScripting

swaroopds
Автор

As an html coder, you should give each of your objects a separate and unique ID, unfortunately this doesn't always happen, and you have to find another way to do what you're wanting, some times with no success. As for already having browsers open, they will be ignored, as the code creates a new instance of iexplorer, when we right the code CreateObject and set it to be internet explorer. I will be making a part 3 however sometime in the future on how to use already opened browsers.

SimplyCoded
Автор

Wonderful.
Friend, may I know how to close Microsoft Edge using VBA please?

sokchomrernean
Автор

hi there, I've been trying to make this work to navigate around Active Server Pages, but having no luck. Have you any advice on how to do this? I need to ba able to click through a bunch of menus to get to the righ section so I can onput the data.

karlkeegan
Автор

Thank you sir for this tutorial, it helps me a lot.im just a newbie in vbscript
also i just want to ask how the script could click on a link on a website, i cant use the navigate function cause the link has a javascript function and it also has no id,

also the link iterates based on a list, ,
thank you sir.

vicavila
Автор

i have trouble. when ie run, him window not active and in search bar dont type words. please help.

КонстантинБабаджанов-ып
join shbcf.ru