Results 1 to 12 of 12
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts

    Determining whether Google Chrome webpage is loaded

    Does anyone know how to determine if a web page is loaded via MS Access VBA?
    If so, is it easy enough to determine if a button can be pushed and further select the 2nd of the 2 options it presents?

  2. #2
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    222
    Thanks
    0
    Thanked 21 Times in 20 Posts
    Quote Originally Posted by patt View Post
    Does anyone know how to determine if a web page is loaded via MS Access VBA?
    If so, is it easy enough to determine if a button can be pushed and further select the 2nd of the 2 options it presents?
    You can certainly add a Web Browser control to a form, Navigate to a particular url and test to see whether the the navigation has completed. I have to go out for a while, but if no one else replies I'll see if I can dig out some code later!

    Not sure about testing whether a button "can be pushed" - do you mean finding whether there is a clickable button on the page, or a drop-down list, or something else?

  3. #3
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    10,307
    Thanks
    130
    Thanked 1,159 Times in 1,067 Posts
    Do you have control over the web page? I ask because the way to determine whether an option was chosen in a web page involves Javascript. Probably the best way would be to add javascript to start an ajax action that would result in a change of a database value, and you could check that change from Access...
    Rui
    -------
    R4

  4. #4
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    222
    Thanks
    0
    Thanked 21 Times in 20 Posts
    In Access 2010, if I add a Web Browser control to a blank form and leave it with its default name of WebBrowser1, then the following code demonstrates simple page navigation using this control (note: I didn't have to add any references to the project for this code to compile and run OK):
    Code:
        WebBrowser1.Navigate "www.google.com"
    
        Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
            DoEvents
        Loop
    In a "real" app you would want some way of dropping out of the Do loop - perhaps if a preset time interval had been exceeded.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts
    What I want to do is (via VBA) to go to a particular URL (one of a number of URLs), then click a button on that page (this is literally a drop down box) and click a 2nd option it drops down.
    I don't need to test for a particular URL as I can fire them using Application.FollowHyperlink, although it would be nice to test if a particular URL was loaded.

  6. #6
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    222
    Thanks
    0
    Thanked 21 Times in 20 Posts
    Quote Originally Posted by patt View Post
    What I want to do is (via VBA) to go to a particular URL (one of a number of URLs), then click a button on that page (this is literally a drop down box) and click a 2nd option it drops down.
    I don't need to test for a particular URL as I can fire them using Application.FollowHyperlink, although it would be nice to test if a particular URL was loaded.
    Can you provide a link to one of the URLs in question and an indication of which dropdown box / value is involved, or is this a private site you are accessing?

    I don't know if what you want to do is possible using VBA, but I'd like to have something to have a look at

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts
    I have included a jpg of part of the screen, it is a screen where I trade forex so cannot give you the url for privacy.
    The button is on the RHS labelled Export to Excel.

  8. #8
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    222
    Thanks
    0
    Thanked 21 Times in 20 Posts
    Quote Originally Posted by patt View Post
    I have included a jpg of part of the screen, it is a screen where I trade forex so cannot give you the url for privacy.
    The button is on the RHS labelled Export to Excel.
    I can't see any jpg image I'm afraid. I'm out of ideas without a live website to practise on - perhaps someone with more web experience can help out

  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts
    Here is the url
    http://www.zulutrade.com/trader/163315
    it is no good because it won't show the button if you are not signed in.
    How do I add a jpg in here?
    Last edited by patt; 2013-07-04 at 18:10.

  10. #10
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts
    Can you put me onto any documentation that may give me clues on how to do this?

  11. #11
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Redditch, Worcestershire, England
    Posts
    222
    Thanks
    0
    Thanked 21 Times in 20 Posts
    Quote Originally Posted by patt View Post
    Can you put me onto any documentation that may give me clues on how to do this?
    My own knowledge on this is fairly limited I'm afraid - I was hoping that it might be possible to identify the particular page element as you can with Javascript, and somehow manipulate that object to simulate a 'click' or 'select' action. The relevant body of knowledge is known as the Document Object Model (DOM) for HTML and is typically described in Javascript articles, although you can certainly get at the HTML document property of a web page from VBA using the WebBrowser control I suggested in my earlier post.

    Good luck

  12. #12
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,537
    Thanks
    0
    Thanked 23 Times in 23 Posts
    Thanks for your efforts, onwards I go

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •