Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

VBScript to open (BG) web page, send ID, PW, "Enter", then scrape info from next page

$
0
0
As the title says....
Create a VBS file to:
open in background a webpage
provide login ID and Password to it
send "enter"
(this process then invokes another page)
then read this next page and scrape some data/info from it
then write this data/info to a file

The whole idea is there is a site which provides information
but there is a login page which you must go through first

I want to do all this in the background....
Login, invoke the next page, obtain data from it, then write data to a text file

I can invoke the first page easy
Code:

dim url
url = "www.something.com"
set wshshell = wscript.createobject("wscript.shell")
set http = createobject("microsoft.xmlhttp")
on error resume next
http.open "get", url, false
http.send

Now is where I am getting trouble

I don't know how to set the ID and Password fields of the first page to correct values
I then assume that sending a "{ENTER}" to it will make it proceed
So I have:

wshshell.sendkeys "ID"
wshshell.sendkeys "Password"
wshshell.sendkeys "{ENTER}"

But nothing happens

When I finally get this to work, how do I get the next page
so I can scrape it ?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>