+ Reply to Thread
Results 1 to 8 of 8

Search a Text in source code of multiple websites through Excel

  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    1

    Search a Text in source code of multiple websites through Excel

    I have multiple urls. I want to use excel for checking a specific text in source code of every URLs (websites).
    Please help me by giving me a sample excel document.
    The idea is , I will put all URLS in a column. Then excel will go through the source code of every URL. In next column it will say after running the program about status of text which I am trying to find in source code.

    I am totally new to excel.

    Thanks
    Prashant

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: I want to Search a Text in source code of multiple websites through Excel

    Please have a look at the attachment. The macro will download the text of the site and search for the specified term. If gives true if it finds it.

    The code can be seen in Module1 in the VBA editor (Alt F11)
    Attached Files Attached Files
    Martin

  3. #3
    Registered User
    Join Date
    01-28-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: I want to Search a Text in source code of multiple websites through Excel

    Hi mrice,

    Apologies for my green-ness but I have exactly the same problem as the OP. However, I get an error when I run the example - a problem with "Open "C:/temp/myfile" For Input As #1"

    Could it be the version of Excel causing the issue (I'm on 2010)? Can the source code be written elsewhere?

    Any help would be greatly appreciated!

    Thanks,

    Daniel

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: I want to Search a Text in source code of multiple websites through Excel

    Is the file C:/temp/myfile being created - can you find it on your C drive?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,701

    Re: Search a Text in source code of multiple websites through Excel

    Seems to be a problem getting the Google data and, consequently, creating/finding the temp file.


    Maybe a bit of overkill on the error handling but ...

    Please Login or Register  to view this content.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Registered User
    Join Date
    01-28-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Search a Text in source code of multiple websites through Excel

    Hi mrice/TMS,

    Thanks for your speedy replies and help.

    @mrice - No I can't find that file so I guess its not being created?

    @TMS - I'm getting a runtime error when I run your solution (same as the original solution) and it points out "Open sFile For Input As #1" as the issue when I debug. However, it has some life in it as it returns "FALSE" next to the hyperlink to this site (which has 7 or so mentions of "macro")!

    Daniel

  7. #7
    Registered User
    Join Date
    09-02-2017
    Location
    Paris, France
    MS-Off Ver
    2016
    Posts
    1

    Re: Search a Text in source code of multiple websites through Excel

    Hi all.
    I have been scouring the internet for a solution that does just this and have the same error. Can you help?
    I tried to create a dir and file "myfile" to help but too no avail.
    Since the thread is old, maybe there are more modern solutions to this?
    Many thanks in advance for the help.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,701

    Re: Search a Text in source code of multiple websites through Excel

    @pizzaiollo: Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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] Trouble saving a websites source code to a text file.
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-12-2013, 09:11 AM
  2. [SOLVED] URLs and navigating websites to pull source code
    By Zaf01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2012, 04:47 PM
  3. Importing multiple web page source code to excel.
    By Diveboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2012, 06:12 PM
  4. Search HTML source code for text
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-23-2009, 10:54 AM
  5. Anchor Text to link to multiple websites
    By boyblue in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2007, 10:58 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