Results 1 to 4 of 4

Web Scraping

Threaded View

  1. #1
    Registered User
    Join Date
    01-14-2011
    Location
    Gig Harbor, WA
    MS-Off Ver
    Excel 2010
    Posts
    24

    Web Scraping

    I am trying to pull the 2014 assessed values from my county assessors website and put them into a spreadsheet. I have the parcel numbers of the properties that I need and I would like to enter the assessed values next to the parcel numbers. The code below is what I have so far. I'm able to get the information from the table on the website to import into the spreadsheet but getting the right cell to copy into the cell next to the right parcel number and loop correctly has stumped me. If there is a better way of doing this where I don't need to import the entire table and then delete it every time let me know. I'm not too familiar with web programming. I have also attached a sample of parcel numbers. Thanks!

    Sub Scrape()
    '
    ' Scrape Macro
    '
    
    '
        For i = 1 To 2
            ThisParcel = ActiveSheet.Cells(i, 1)
            ThisValue = ActiveSheet.Cells(i, 2)
            
        
        With ActiveSheet.QueryTables.Add(Connection:= _
            "URL;http://epip.co.pierce.wa.us/cfapps/atr/epip/taxvalue.cfm?parcel=" & ThisParcel, Destination:=Range("$C$2"))
            .Name = "taxvalue.cfm?parcel=" & ThisParcel
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .WebSelectionType = xlSpecifiedTables
            .WebFormatting = xlWebFormattingNone
            .WebTables = "10"
            .WebPreFormattedTextToColumns = True
            .WebConsecutiveDelimitersAsOne = True
            .WebSingleBlockTextImport = False
            .WebDisableDateRecognition = False
            .WebDisableRedirections = False
            .Refresh BackgroundQuery:=False
            
        End With
        
            Range("F3").Select
            Selection.Copy
            ThisValue.Select
            ActiveSheet.Paste
            Range("C2:J11").Select
            Application.CutCopyMode = False
            Selection.QueryTable.Delete
            Selection.ClearContents
            Range("B2").Select
        
        Next i
        
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Web Scraping Question
    By vexel77 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-21-2013, 05:21 PM
  2. [SOLVED] Web scraping with xml
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2012, 05:25 AM
  3. Web Scraping Query - Please Help
    By benjison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-16-2012, 08:03 PM
  4. Web scraping
    By mickbarry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2006, 06:25 AM
  5. Web Screen Scraping
    By scottymelloty in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2005, 09:53 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