+ Reply to Thread
Results 1 to 7 of 7

VBA scraping of HTML

  1. #1
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    VBA scraping of HTML

    Hi all,

    Currently I have got a VBA which scrapes through links and tables that are stored inside sheet called web_links. But if you check sheet web_data the data is a little off the columns not where it should be. My question would be how can I update this VBA so it only downloads data from tables with the following ID's: product-name, price-box?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: VBA scraping of HTML

    Ok, let me simplify the question a little.

    How do I return price from the class below:

    Capture.PNG

    I tried to use the VBA below but it is returning me the error code 438 object doesnt support this property or method.

    Desired outcome should be a massage box showing 75.21 inside.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA scraping of HTML

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: VBA scraping of HTML

    Ok, that makes sense. But how do I loop right now through all of the regular-price classes on this link and put them all together into the long string so I can split it later?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: VBA scraping of HTML

    Hi,

    If you are inclined to use/understand Power Query (Get & Transform in 2016) then this site explains how to do your problem.
    https://www.mattmasson.com/2014/11/i...g-power-query/
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA scraping of HTML

    I am going to shoot off un momento and will not check in until tomorrow.
    Loop through the regular price class, but you need to cut and slice the text as some of them have a "Price" word attached to them.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-21-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    131

    Re: VBA scraping of HTML

    Justt a quick one, what are you suggesting to Dim Price as? As you have not dimmed it in your code:
    Please Login or Register  to view this content.
    Never mind it's dimmed as object.

    @MarvinP, thank you for a tip I will have a look into it and will see if I can use that.
    Last edited by ChipsSlave; 07-28-2017 at 01:15 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA scraping specific value from website HTML
    By Strutland in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2017, 10:06 AM
  2. Replies: 2
    Last Post: 01-07-2016, 12:25 PM
  3. VBA to Import HTML Table Locally Stored HTML file to excel
    By ermengard in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-09-2015, 10:48 AM
  4. Excel ws into outlook html body with current html signature
    By Cadelanne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-29-2014, 09:03 AM
  5. HTML scraping using VBA
    By MacroLide in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-26-2012, 11:12 AM
  6. convert formated excel column to html source text with html tags
    By julia81 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-19-2011, 04:22 PM
  7. How to add HTML header/footer to export as HTML?
    By JGCA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2009, 04:29 PM

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