+ Reply to Thread
Results 1 to 6 of 6

How would I grab the source code from a website and place it into a text file using vba?

  1. #1
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    How would I grab the source code from a website and place it into a text file using vba?

    Essentially it would be a web scraper. I'm either looking for existing free code or a good place to learn how to make one.
    Last edited by 111StepsAhead; 06-14-2012 at 10:23 AM. Reason: Users posted 2 solutions to the problem.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: How would I grab the source code from a website and place it into a text file using vb

    I'm sure there are many different ways, but this may help
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: How would I grab the source code from a website and place it into a text file using vb

    Typically you wouldn't use vba for this, however since you want t ouse VBA, see if this gets you started:
    Please Login or Register  to view this content.
    Webscraping can get very complex very quickly and as I said VBA isn't the ideal tool

  4. #4
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: How would I grab the source code from a website and place it into a text file using vb

    Thanks for the quick responses. Hope you guys didn't have to put too much effort into making that code. I am trying to expand on what I've learned over the last few months here and this seemed like a fun way to do that. Both of your guys code worked great.

    I will mark this thread as solved but as an extra question, what programming language would be better for webscraping?

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: How would I grab the source code from a website and place it into a text file using vb

    Probably Python

  6. #6
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Re: How would I grab the source code from a website and place it into a text file using vb

    Quote Originally Posted by Kyle123 View Post
    Probably Python
    I shall keep this in mind when I get some free time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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