Results 1 to 3 of 3
  1. #1
    talhaparvaiz@yahoo.com is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2020
    Posts
    29

    gather data from various websites and save it to MS Access.

    Hello,
    I'm attempting to gather data from various websites and save it to MS Access.
    The provided code is provided by one of the experts is functioning to some extent, but it intermittently throws an error. While it successfully extracts data, it occasionally displays an error message when encountering an invalid website. This inconsistency in behavior is causing an issue.






    The error message and file is attached:












    Thanks
    Attached Thumbnails Attached Thumbnails MS Access error.png  
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Perhaps you should add error handling code. Review http://allenbrowne.com/ser-23a.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
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    You have to check and see if the tags exist before trying to manipulate them:

    Code:
        i = InStr(1, htmlContent, "<tr>")
        If i > 0 Then
            htmlContent = Trim$(Mid$(htmlContent, i))
        End If
        i = InStrRev(htmlContent, "</tr>")
        If i > 0 Then
            htmlContent = Trim$(Left$(htmlContent, i - 1))
        End If

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

Similar Threads

  1. Replies: 8
    Last Post: 11-10-2015, 08:50 AM
  2. Creating email to gather data
    By spelo1 in forum Import/Export Data
    Replies: 1
    Last Post: 10-05-2015, 01:34 PM
  3. Looking for websites on Access for the web
    By John_G in forum Access
    Replies: 1
    Last Post: 01-19-2015, 10:46 AM
  4. gather data in one field
    By le_sayan in forum Forms
    Replies: 1
    Last Post: 09-03-2013, 01:58 AM
  5. Get a websites source code with access
    By trb5016 in forum Programming
    Replies: 1
    Last Post: 01-08-2010, 03:23 PM

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