+ Reply to Thread
Results 1 to 6 of 6

Extracting Innertext Values of TD by Finding Common Word

  1. #1
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    Extracting Innertext Values of TD by Finding Common Word

    Greetings!

    I am currently working in an automation that will extract values of innertext with common word from all rows. Example is the word "DOWN" is common to all table and I want to extract all the values of the row with the word "DOWN" and extract it to the excel sheet. can you help me by making a vba code that will look up for the word "DOWN" in webpage and then will copy the innertext values before and after the said common word.

    see the screenshot for the idea.
    nagios.jpg

    here is the html codes for the said table.
    Please Login or Register  to view this content.
    I want to extract all rows that has the word "DOWN" and then put it in an excel sheet.

    I think maybe this code is suitable for extraction, I just don't know how to revise it to match the requirements.

    Please Login or Register  to view this content.
    since the table is changing regularly, setting a definite number of this code is not applicable, we just have to provide a code that will extract ALL rows with the word "DOWN", hope you get my idea.
    "Consummatum Est"

  2. #2
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    Re: Extracting Innertext Values of TD by Finding Common Word

    the code will run
    the code will find the word "DOWN" in td elements
    the code will extract the other values in the row where the word "DOWN" is, [e.g. 191_sector_3, DOWN, 03-27-2012 16:20:42, 2d 6h 4m 47s, (Host Check Timed Out) ]
    the code will put the extracted values to the sheet
    the code will run again to find another row containing the word "DOWN"
    the code will extract again the values in the row
    the code will run until the last row containing "DOWN" is extracted.

    http://img821.imageshack.us/img821/3223/nagios.jpg

  3. #3
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    Re: Extracting Innertext Values of TD by Finding Common Word

    here is the workbook, example is a sheet I wanted to become, the values will be extracted in this manner.

    AP Alarms.xlsx

  4. #4
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    Re: Extracting Innertext Values of TD by Finding Common Word

    bump no response

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Extracting Innertext Values of TD by Finding Common Word

    maybe something like this
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-21-2012
    Location
    Metro Manila, Phiippines
    MS-Off Ver
    Office 2007
    Posts
    77

    Re: Extracting Innertext Values of TD by Finding Common Word

    yes nilem, the idea is correct, but I will be extracting the data directly from the webpage, as given with html codes.

+ 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