Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #12456 > unrolled thread

how to wait for website?

Started byLouis Noser <louis.noser@gmx.ch>
First post2022-06-02 09:18 +0200
Last post2022-06-03 13:16 -0400
Articles 7 — 3 participants

Back to article view | Back to microsoft.public.scripting.vbscript


Contents

  how to wait for website? Louis Noser <louis.noser@gmx.ch> - 2022-06-02 09:18 +0200
    Re: how to wait for website? Louis Noser <louis.noser@gmx.ch> - 2022-06-02 09:25 +0200
      Re: how to wait for website? "Mayayana" <mayayana@invalid.nospam> - 2022-06-02 08:30 -0400
        Re: how to wait for website? Louis Noser <louis.noser@gmx.ch> - 2022-06-02 15:53 +0200
          Re: how to wait for website? "Mayayana" <mayayana@invalid.nospam> - 2022-06-02 14:43 -0400
            Re: how to wait for website? JJ <jj4public@gmx.com> - 2022-06-03 17:57 +0700
              Re: how to wait for website? "Mayayana" <mayayana@invalid.nospam> - 2022-06-03 13:16 -0400

#12456 — how to wait for website?

FromLouis Noser <louis.noser@gmx.ch>
Date2022-06-02 09:18 +0200
Subjecthow to wait for website?
Message-ID<jfr6hpFcc0oU1@mid.individual.net>
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

[toc] | [next] | [standalone]


#12457

FromLouis Noser <louis.noser@gmx.ch>
Date2022-06-02 09:25 +0200
Message-ID<jfr6uqFcethU1@mid.individual.net>
In reply to#12456
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}"

[toc] | [prev] | [next] | [standalone]


#12458

From"Mayayana" <mayayana@invalid.nospam>
Date2022-06-02 08:30 -0400
Message-ID<t7aagp$h6t$1@dont-email.me>
In reply to#12457
"Louis Noser" <louis.noser@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. :)

[toc] | [prev] | [next] | [standalone]


#12459

FromLouis Noser <louis.noser@gmx.ch>
Date2022-06-02 15:53 +0200
Message-ID<jfrtm2Fgbv6U1@mid.individual.net>
In reply to#12458
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?

[toc] | [prev] | [next] | [standalone]


#12460

From"Mayayana" <mayayana@invalid.nospam>
Date2022-06-02 14:43 -0400
Message-ID<t7b0c5$2q9$1@dont-email.me>
In reply to#12459
"Louis Noser" <louis.noser@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. 

[toc] | [prev] | [next] | [standalone]


#12461

FromJJ <jj4public@gmx.com>
Date2022-06-03 17:57 +0700
Message-ID<1dwbjpoc8d0zq$.15glnvwn91dd3$.dlg@40tude.net>
In reply to#12460
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.

[toc] | [prev] | [next] | [standalone]


#12462

From"Mayayana" <mayayana@invalid.nospam>
Date2022-06-03 13:16 -0400
Message-ID<t7dfl1$l1q$1@dont-email.me>
In reply to#12461
"JJ" <jj4public@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. 

[toc] | [prev] | [standalone]


Back to top | Article view | microsoft.public.scripting.vbscript


csiph-web