Web Images News Groups Scholar Blogs Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Simulating a button click to bypass a prompt
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
piancu  
View profile  
 More options Oct 30, 3:29 am
Newsgroups: microsoft.public.scripting.vbscript
From: piancu <paul.r.ia...@gmail.com>
Date: Thu, 29 Oct 2009 20:29:18 -0700 (PDT)
Local: Fri, Oct 30 2009 3:29 am
Subject: Simulating a button click to bypass a prompt
Hi everyone. I'm trying to use VB script to load a table from a HTML
page to a text file. The problem is that the webpage has a EULA
agreement prompt which i need to get past in order to download the
table. I get an error message about button sometimes but at times the
button is being clicked, although IE.document.body is non-existent and
nothing gets written to the file.

Do any of you know how I can click the button that appears but at the
same time be able to access the document body of the page I get to.

Thanks
Paul

    Dim strContents
    Dim row
    Dim Tables, Table
    Dim IE, IE2, IE3
    Dim TableData, Td, Tr, Trs
    Dim Data, Data1
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Visible = True
    IE.Navigate ("https://www.noridianmedicare.com/p-medb/enroll/
optout/oregon_optout.html")
    Do While IE.Busy
    Loop
    wscript.sleep(100)

    strContents = Space(1)
    IE.document.getElementbyID("eula-accept").click()

    Set Tables = IE.document.Body.getElementsbyTagName("table")

    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteStuff = myFSO.OpenTextFile("\\db1\production\Files
\MedicareOptoutProviderList\medicareoptout.txt", 2, True)

    For Each Table In Tables
        Set TableData = Tables.Item(0)
        Set Trs = TableData.getElementsbyTagName("tr")
        For Each Tr In Trs
            Set Data = Tr.getElementsbyTagName("td")
            For Each Td In Data
                row = row & Td.innertext & vbTab
            Next
            row = Replace(row, vbCrLf, strContents)
            WriteStuff.WriteLine(row)
            row = ""
        Next
    Next
    WriteStuff.Close
    IE.Quit


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Oct 30, 10:17 am
Newsgroups: microsoft.public.scripting.vbscript
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Fri, 30 Oct 2009 11:17:09 +0100
Local: Fri, Oct 30 2009 10:17 am
Subject: Re: Simulating a button click to bypass a prompt

"piancu" <paul.r.ia...@gmail.com> wrote in message

news:e1f622dc-d889-407b-bcf7-12761ee94675@y10g2000prg.googlegroups.com...

If you open the three web pages below in the shown order then you should be
able to access your table:

1. https://www.noridianmedicare.com/p-medb/enroll/optout/oregon_optout.html
2. https://www.noridianmedicare.com/eula.php?t=%2Fp-medb%2Fenroll%2F&agr...
3. https://www.noridianmedicare.com/p-medb/enroll/optout/oregon_optout.html


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
piancu  
View profile  
 More options Oct 30, 6:07 pm
Newsgroups: microsoft.public.scripting.vbscript
From: piancu <paul.r.ia...@gmail.com>
Date: Fri, 30 Oct 2009 11:07:13 -0700 (PDT)
Local: Fri, Oct 30 2009 6:07 pm
Subject: Re: Simulating a button click to bypass a prompt
On Oct 30, 3:17 am, "Pegasus [MVP]" <n...@microsoft.com> wrote:

Thank You! The navigation works but the document body doesn't seem to
have anything in it.

    IE.Navigate ("https://www.noridianmedicare.com/p-medb/enroll/
optout/oregon_optout.html")
    Do While IE.Busy
    Loop
    IE.Navigate ("https://www.noridianmedicare.com/%2Fp-medb%2Fenroll
%2F&agree=1")
    Do While IE.Busy
    Loop
    IE.Navigate ("https://www.noridianmedicare.com/p-medb/enroll/
optout/oregon_optout.html")
    Do While IE.Busy
    Loop
    wscript.sleep(100)

    strContents = Space(1)

    Set Tables = IE.document.Body.getElementsbyTagName("table")


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
piancu  
View profile  
 More options Oct 30, 8:17 pm
Newsgroups: microsoft.public.scripting.vbscript
From: piancu <paul.r.ia...@gmail.com>
Date: Fri, 30 Oct 2009 13:17:10 -0700 (PDT)
Local: Fri, Oct 30 2009 8:17 pm
Subject: Re: Simulating a button click to bypass a prompt
On Oct 30, 11:07 am, piancu <paul.r.ia...@gmail.com> wrote:

I found the problem. I had to use the url of the I Agree button, the
url that appears at the bottom of the browser window when the mouse is
over the button.

IE.Navigate ("https://www.noridianmedicare.com/eula.php?t=%2Fp-medb
%2Fenroll%2Foptout2Foregon_optout.html&agree=1")


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Oct 30, 8:36 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Fri, 30 Oct 2009 21:36:31 +0100
Local: Fri, Oct 30 2009 8:36 pm
Subject: Re: Simulating a button click to bypass a prompt

"piancu" <paul.r.ia...@gmail.com> wrote in message

news:6a962ee1-e96a-496d-bc2d-e36305890821@y28g2000prd.googlegroups.com...
On Oct 30, 11:07 am, piancu <paul.r.ia...@gmail.com> wrote:

I found the problem. I had to use the url of the I Agree button, the
url that appears at the bottom of the browser window when the mouse is
over the button.

IE.Navigate ("https://www.noridianmedicare.com/eula.php?t=%2Fp-medb
%2Fenroll%2Foptout2Foregon_optout.html&agree=1")

=============

Thanks for the feedback.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google