+ Reply to Thread
Results 1 to 21 of 21

Crawling list of web pages for specific value(s) on page

  1. #1
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Question Crawling list of web pages for specific value(s) on page

    Anyone able to point me in the right direction? My VB skills are null at best, but I'm looking to supply a column of URLs and crawl them for a specific value in the pages crawled and return that in the next column. It seems simple enough in my mind, but of course I'm not familiar with VB.

  2. #2
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    Bump. I take it this isn't within anyone's realm of expertise.

  3. #3
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Crawling list of web pages for specific value(s) on page

    Hi an_otter,

    So you want to have a bunch of urls in one column then press a button and the vba opens the website and looks for a specific value and paste that value next to the link if it exists?

    Some questions
    1. Is the value the same for all urls?
    2. Is the value somewhere in the text of the page or is it in the html code?

    Gesendet von meinem HTC One mit Tapatalk

  4. #4
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    hi loki,

    1. The value should be the same for all URLs, yes, they'll all have the same structure.
    2. The value is in the text of the page, yes.

  5. #5
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Crawling list of web pages for specific value(s) on page

    Good if no one comes up with something I will look into it the next days

    Gesendet von meinem HTC One mit Tapatalk

  6. #6
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    I really appreciate it. I may even be able to offer some sort of compensation given our group's need for this.

  7. #7
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Crawling list of web pages for specific value(s) on page

    Hi buddy,

    I quickly made something for you you can put the URL in Column A and the Word you want to search in Column B.
    If the Word is Found within the Page it writes Found in Column C.

    Test it with your URLs and give me Feedback if you need changes.
    Note that its case Sensitive can change that too if needed.

    Greets
    Loki
    Attached Files Attached Files

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

    Re: Crawling list of web pages for specific value(s) on page

    Hi Loki,

    I rejigged your code to make it faster, using IE should really be the option of last resort

    Please Login or Register  to view this content.
    Last edited by Kyle123; 08-17-2015 at 06:13 AM.

  9. #9
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Crawling list of web pages for specific value(s) on page

    Hi Kyle,

    Cool, thanks for the info i did not know that you can do that without IE.

    Greets
    Loki

  10. #10
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    Thanks for the scripts, guys. One snag, though:

    The value I'll be looking for isn't consistent, but the page and class location of that value will be, nor will it be in the Excel sheet itself for the same reason. All I can provide is the URLs to crawl.

    To give you an example, say I'm looking through:

    http://www.website.com/page-1.html
    http://www.website.com/page-2.html
    http://www.website.com/page-3.html

    On each there will be an element that's more or less consistent to this:

    <div class="product-count">15 items found for</div>

    The value of that div ('# items found for') will change depending on each page's product count, but the div location and class remains consistent. In hindsight I should've clarified this detail originally, I'm sorry.

  11. #11
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    Bump. Any ideas how I could re-gear your guys' macro to take into account the new detail?

  12. #12
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Crawling list of web pages for specific value(s) on page

    try to append this to Kyle's code:

    Please Login or Register  to view this content.
    Regards,
    Rick

  13. #13
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    You beautiful man, it works perfectly.

    I want to thank all of you. If any of you have PayPals or what have you, send me a message, I'd love to throw you some beer money for the effort. Either way, thanks so much.

  14. #14
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    Hm, I'm getting a debug error when using pages where product-count div isn't being found at all, halting the crawl. Is there any way to add a fall-back alternative check or at least to have it skip the row and move on to the next?

    edit: Also, how would I truncate the Mid value to remove the lTopicstart portion of the div. I just want the value
    Last edited by an_otter; 08-31-2015 at 05:35 PM.

  15. #15
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Crawling list of web pages for specific value(s) on page

    Hi Otter,

    Try this (this is the dirty way :D):

    Please Login or Register  to view this content.
    Cheers,
    Rick

  16. #16
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    Thanks, Rick, that works fantastically. Is there a way to add an OR clause to that StrStart variable? As a sort of fall-back element to look for? Like:


    StrStart = "<div class=""product-count"">" OR "<div style=""float:left;font-size:12px;color:#52335F;"">"


    I know I'm being a picky brat at this point, but that's my last quibble.

  17. #17
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Crawling list of web pages for specific value(s) on page

    How about this:

    Please Login or Register  to view this content.
    Cheers,
    Rick
    Last edited by rkey; 09-01-2015 at 03:55 PM. Reason: changed Len(StrStart) to Len(StrStartReserve) in the nested if

  18. #18
    Registered User
    Join Date
    02-18-2011
    Location
    No, Thank You
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Crawling list of web pages for specific value(s) on page

    God you're good, that works pretty much perfectly. Thanks again, Rick!

  19. #19
    Registered User
    Join Date
    12-15-2009
    Location
    USA
    MS-Off Ver
    2003,2007,2010,2013
    Posts
    28

    Re: Crawling list of web pages for specific value(s) on page

    Sorry I'm a bit late to this party. I just received an email from ExcelForum about it. While it seems a good solution has been offered (and one that does not involve Internet Explorer), I have a different solution (that does involve Internet Explorer) but does not require VBA skills - tho - if you have VBA skills the provided function library can be used to do far more than just web crawling.

    It is far too comprehensive to put into a forum post so I offer this 4 minute demo video so readers can determine if it is something they could use. It is free (I am not a commercial enterprise) to any ExcelForum member who wants it and for the benefit of all, the code is unprotected.

    https://youtu.be/mxZBVMfcUKc

  20. #20
    Registered User
    Join Date
    11-17-2015
    Location
    Delhi
    MS-Off Ver
    2007
    Posts
    1

    Re: Crawling list of web pages for specific value(s) on page

    Hi All
    Anybody can you please tell me how to crawl data/content from a particular web page.

  21. #21
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,600

    Re: Crawling list of web pages for specific value(s) on page

    @Simrankaur,
    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.
    Ben Van Johnson

+ 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. Replies: 0
    Last Post: 09-02-2014, 12:59 PM
  2. Replies: 0
    Last Post: 07-30-2014, 11:25 AM
  3. Page Numbers - how to set to specific pages?
    By ogiebear in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-21-2013, 11:47 AM
  4. Replies: 2
    Last Post: 08-02-2013, 08:04 AM
  5. Replies: 5
    Last Post: 05-01-2012, 04:27 PM
  6. Conditional Sumif across multiple pages with page list
    By Prcntrygrl in forum Excel General
    Replies: 10
    Last Post: 12-11-2011, 03:47 PM
  7. Replies: 4
    Last Post: 09-13-2011, 06:54 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