Results 1 to 6 of 6
  1. #1
    PATRICK is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    32

    get text info from webpage into my text field

    Im trying to get information from webpage. (http://benwerd.com/lab/geo.php)

    Im using the code:
    Set ie = CreateObject("internetexplorer.application")
    ie.Visible = True


    ie.Navigate "http://benwerd.com/lab/geo.php"
    While ie.Busy
    DoEvents
    Wend
    Me.txtlat = ie.Document.getElementById("xxxxxxx").... here is the info I can't get from the page. Can't find the id or element that hold the information, latitude, longitude ... that is listed in the website.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    I tried that link in IE and get message that my browser does not support geolocation. Firefox and Chrome message is 'Waiting for browser...', nothing happens. Guess I am way out of date. Will try another computer later.

    Did you View Source from IE? Can't find the elements in Source?

    Review

    https://www.accessforums.net/import-...ite-25688.html

    https://www.accessforums.net/forms/a...her-34620.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    PATRICK is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    32
    Yes I did. but the information is kind inside of a jquery script or something, there''s no Id where I could get the info. basically the geolocation function is from webbroser. I'll paste here part of the source code:



    <scriptlanguage="javascript">




    /*

    * The interesting stuff starts here ...

    */



    // This is just to show the Google Map - not related to the HTML5 geolocation API


    function googleMapShow(lat,long) {


    var latlng = new google.maps.LatLng(lat, long);


    var myOptions = {

    zoom: 14,

    center: latlng,

    mapTypeId: google.maps.MapTypeId.ROADMAP

    };


    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    }






    // Use jQuery to display useful information about our position.


    function exportPosition(position) {

    $(
    '#georesults').html(


    '<div id="map_canvas" style="float: right; width: 200px; height: 200px"></div>' +


    '<p>'

    +
    'Latitude: ' + position.coords.latitude + '<br />'

    +
    'Longitude: ' + position.coords.longitude + '<br />'

    +
    'Accuracy: ' + position.coords.accuracy + '<br />'

    +
    'Altitude: ' + position.coords.altitude + '<br />'

    +
    'Altitude accuracy: ' + position.coords.altitudeAccuracy + '<br />'

    +
    'Heading: ' + position.coords.heading + '<br />'

    +
    'Speed: ' + position.coords.speed + '<br />'

    +
    '</p>'

    );

    googleMapShow(

    position.coords.latitude,

    position.coords.longitude,

    {maximumAge:600000});

    }



  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    On another computer now. The site wants to 'track my location', I say no and nothing happens except it says "The page could not get your location". Refreshing or reopening the page doesn't change that message. Not another chance to say yes? What is this site for?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    PATRICK is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    32
    You have to say Yes... the site gives your current location using google maps (latitude, longitude...) so, I need this info to track information into my database, this is new feature on html5 but google api doenst have option for vba, so I need to call this web and get the info from there, or any other web, as long it give me the geolocation... I can even do my own page and put it in a server just so only myself will access to have the geolocation that works in html5 against google mapgs... you can say yes after that you will see the source code.

    To have the website ask you again, go to internet options, Privacy, and unmark "Never allow web to request location" and "clear sites".... you should be asked again after that.
    Last edited by June7; 08-09-2013 at 12:12 PM.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Searching the html source behind the page won't work because the lat/long values are not actually there, only variables in a jquery script, as you noted. The View Source is just text, the variables displayed aren't really populated with data. Have to search the rendered web page, not the source view, and since there is no elementID, as you also noted, there is nothing to reference.

    I found this for Excel http://xlvba.fr.yuku.com/topic/33#.UgW_hV_TmCh
    It displays the page but page says "Waiting for browser ..."
    I did get this to work with a different website page.

    I tried using Access Web Browser control.
    It displays the page but page says "Your browser does not support geolocation".

    This looked promising http://www.mrexcel.com/forum/excel-q...xt-string.html
    I adjusted the code to run in Access.
    With the benwerd.com page code runs without error but no results returned.
    However, again, it worked beautifully with a different website page, one that does not need authorization response from client.

    What is really needed is an API that downloads the data into xml, like shown in the second link I provided earlier.
    Last edited by June7; 08-10-2013 at 01:47 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Text Box not retaining info
    By Stephanie53 in forum Forms
    Replies: 5
    Last Post: 05-30-2013, 11:44 AM
  2. Replies: 4
    Last Post: 10-15-2012, 11:38 AM
  3. Replies: 2
    Last Post: 06-11-2012, 09:37 AM
  4. Replies: 12
    Last Post: 06-04-2012, 10:55 AM
  5. Replies: 2
    Last Post: 05-05-2010, 02:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums