Results 1 to 9 of 9

Having trouble scraping data from IE

Threaded View

  1. #1
    Registered User
    Join Date
    02-20-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    5

    Having trouble scraping data from IE

    This is driving me nuts. Pretty new to VBA. Here is the HTML:

    <script type="text/javascript">...</script>
    <div id="b_contant">
    <div id="b_tween">...</div>
    <OL ID="B_RESULTS">
    <LI CLASS="b_ans" data-bm="6">
    <h2>...</h2>
    <cite>bing.com/maps</cite>
    <div class="b_rich">
    <div class="b_imagepair square_xxxb reverse">
    <div class="inner"....</div>
    <div class="b_vpanel">...</div>
    <div class="b_panel">
    <div>
    <div class="b_focusTextSmall">1361.5 mi</div>

    I'm trying to get the 1361.5 mi.

    I've tried:
    Set alltags = IE.Document.getElementsByTagName("div")
    For Each element In alltags
        If element.getAttribute("class") = "b_focusTextSmall" Then
            mileagestring = element.innerText
            selectedtext() = Split(mileagestring, " ")
            miles = selectedtext(0)
    end if
    next
    It finds ~152 div but never finds a class of "b_focusTextSmall".

    What am I missing?
    Last edited by fabolous15; 02-21-2015 at 12:09 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Scraping Data from Web Into Excel Using VBA
    By gurs in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-31-2015, 06:26 PM
  2. Scraping data and pre-processing in one go?
    By xteejx in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 02:41 PM
  3. scraping data from a website
    By redpanda in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-05-2012, 01:20 PM
  4. Scraping Data using VBA
    By Nala2355 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2011, 11:21 AM
  5. Data scraping
    By brewers7 in forum Excel General
    Replies: 8
    Last Post: 02-06-2011, 12:45 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1