Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to wait for website?

36 views
Skip to first unread message

Louis Noser

unread,
Jun 2, 2022, 3:18:21 AM6/2/22
to
Hi

A VBScrict of mine goes to a certain website and fills in fields with
the sendkeys command. Firefox loads the webpage. I've attached the code
I have so far. The tab command sent is just the test if the sendkeys
command works. Up until now, keyboard input has only been possible with
a wait command.

However, the sendkeys command is better off waiting for the web page to
load.

Unfortunately I haven't figured out how to do that yet.

Can someone help?

Many Thanks.
Greetings, Louis

Louis Noser

unread,
Jun 2, 2022, 3:25:19 AM6/2/22
to
Also sprach Louis Noser am 02.06.2022 um 09:18:

> ...I've attached the code
> I have so far.

Here is the code:

Dim url, a
Set url= CreateObject("WScript.Shell")
url.Run
"https://login.raiffeisen.ch/de?Location=https%3A%2F%2Febanking.raiffeisen.ch%2Fapp&webIAMContractNo=3058846EACFB08B56E05B3E9A31DAF5F",
9
WScript.Sleep 10000
Set a = CreateObject("WScript.Shell")
a.SendKeys "{TAB}"

Mayayana

unread,
Jun 2, 2022, 8:30:20 AM6/2/22
to
"Louis Noser" <louis...@gmx.ch> wrote

| > ...I've attached the code
| > I have so far.
|
| Here is the code:
|
| Dim url, a
| Set url= CreateObject("WScript.Shell")
| url.Run
|
"https://login.raiffeisen.ch/de?Location=https%3A%2F%2Febanking.raiffeisen.ch%2Fapp&webIAMContractNo=3058846EACFB08B56E05B3E9A31DAF5F",
| 9
| WScript.Sleep 10000
| Set a = CreateObject("WScript.Shell")
| a.SendKeys "{TAB}"

The typical approach is to loop until document.readyState = 4.
Then once you get it working you throw out the script
because online banking is a crazy thing to do and automating
it with a script is even crazier. :)


Louis Noser

unread,
Jun 2, 2022, 9:53:09 AM6/2/22
to
Also sprach Mayayana am 02.06.2022 um 14:30:

> The typical approach is to loop until document.readyState = 4.

Tx a lot.

What's the code for that?


Mayayana

unread,
Jun 2, 2022, 2:43:20 PM6/2/22
to
"Louis Noser" <louis...@gmx.ch> wrote

| > The typical approach is to loop until document.readyState = 4.
|
| What's the code for that?
|
You'll need access to the document object of the web browser.
Then you just do something like:

Do While document.readyState <> 4
a.Sleep 100
Loop

But this gets very involved. If I were to attempt to do
such a thing I'd want to get access to the document object.
For that you access an IE object. Then again, the only
thing crazier than online banking via script would be doing
it with IE. And doing it that way requires expertise
with webpage scripting. I'm not even certain that it's possible.

If you're just shelling then you really don't have any
access to control the details on the page. Unless you're
going to undertake learning all that.... I'm not sure what your
options are, other than to just wait a long time and hope
for the best.


JJ

unread,
Jun 3, 2022, 6:57:26 AM6/3/22
to
On Thu, 2 Jun 2022 14:43:13 -0400, Mayayana wrote:
>
> For that you access an IE object. Then again, the only
> thing crazier than online banking via script would be doing
> it with IE. And doing it that way requires expertise
> with webpage scripting. I'm not even certain that it's possible.

It's possible. Any program/script which has access to the Shell.Application
object, can peek into the page contents of any MSIE window's active/first
tab (the remaining is inaccessible). Though I can't recall whether it's only
for the active or the first tab.

Mayayana

unread,
Jun 3, 2022, 1:16:20 PM6/3/22
to
"JJ" <jj4p...@gmx.com> wrote

| It's possible. Any program/script which has access to the
Shell.Application
| object, can peek into the page contents of any MSIE window's active/first
| tab (the remaining is inaccessible). Though I can't recall whether it's
only
| for the active or the first tab.

Yes. But I didn't want to get his hopes up because
I wasn't so sure how that would work with a page online,
much less banking. I've only done it with webpages local.

I actually wrote a component that can get the document
object of any open instance of IE or an HTA. It uses
ObjectFromLresult in the accessibility library. But again,
I've never tried such shenanigans online.


0 new messages