+ Reply to Thread
Results 1 to 10 of 10

VBA Script to open webpages and extract information

  1. #1
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    VBA Script to open webpages and extract information

    Hi guys

    I got a model in ArcGIS thats pumping out 17 excel spreadsheets that I merge using excel VBA script into 1 spreadsheet (Sheet1). Not all of these tables contain the same type of information so column D from one spreadsheet might contain a different type of information than what it does in another.

    Anywho, a lot of these tables contain a column containing a web link to a page with a coupple of paragraphs with some text. Would it be possible to write a script using web scraping for example so that it;
    1. Locates which column that contain the links (as previously stated, the link might be in column D in on table but column C in another for example).
    2. Open the HTML link and search through the body of text on the web page for a bunch of species that I have in a long list in another excel spreadsheet (Sheet2) (all in column A)
    3. If it finds species "x" to copy paste species "x" into the merged spreadsheet (Sheet1)

    Thanks in advance
    Last edited by mss90; 05-09-2016 at 03:25 AM.

  2. #2
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: VBA Script to open webpages and extract information

    Hi. Food for thought
    To do it for me and help me it is 2 different things!
    Sorry for my english, blame Google translator

  3. #3
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: VBA Script to open webpages and extract information

    Thanks for fast reply, although when I try your link Im getting; "Sorry - no matches. Please try some different terms."

  4. #4
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: VBA Script to open webpages and extract information

    type in forum search "xmlhttp"

  5. #5
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: VBA Script to open webpages and extract information

    Okay so I got the folling script;
    Please Login or Register  to view this content.
    I found that "Dim myValue As String: myValue = "[@id="faktaark"]/dl[2]/dd[23]"" does not work, I attempted to use both the "selector" and "xpath" of the paragraph of relevant text from the HTML web page but it does not seem to work. What em I doing wrong?

  6. #6
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: VBA Script to open webpages and extract information

    What exactly need to with this page? Show the screenshot of the page itself.

  7. #7
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: VBA Script to open webpages and extract information

    faktaark.JPG

    So thats a picture of most of the page. Idealy I would like the script to search the "Naturtype" paragraph for a lot of species to see of they are in that text. However as its a little complex for a novice for me I am now just trying to copy the entire paragraph into A1

  8. #8
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: VBA Script to open webpages and extract information

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: VBA Script to open webpages and extract information

    How can I only select the "naturtyper" paragraph? naturtyper.JPG

  10. #10
    Forum Contributor
    Join Date
    04-28-2016
    Location
    Stavanger, Norway
    MS-Off Ver
    365
    Posts
    142

    Re: VBA Script to open webpages and extract information

    Quote Originally Posted by mss90 View Post
    How can I only select the "naturtyper" paragraph? Attachment 459898
    I managed using this method;

    Please Login or Register  to view this content.

+ 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. VBA - Second Script to Monitor Timed-out Webpages
    By bubleeshaark in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2014, 12:15 PM
  2. VBA code to extract data from multiple webpages to excel
    By satishphalke in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2014, 02:16 AM
  3. [SOLVED] VBA SCRIPT to copy information to different worksheets based on a criteria
    By Excel_Padwan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-01-2014, 01:31 AM
  4. Extract a Specific data from multiple webpages to excel
    By pari9485 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2013, 01:10 PM
  5. Macro to Open webpages in new instance of Chrome, close after X time.
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2013, 08:15 PM
  6. VBA script to extract data from server
    By crazydude80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2012, 12:13 AM
  7. VBA script for extract, merge and deleting rows
    By jlay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-21-2010, 11:26 AM
  8. [SOLVED] VB script and disappearing information
    By Abi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2005, 05:06 PM

Tags for this Thread

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