Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Scraping a big HTML Table through a single command

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 182
    Comment on it

    Hello Everyone,

    We have seen a lot of websites having big tables in them with lots of rows and columns. 

    What if someday being a developer you feel the need of getting all that data from the website at once without going the nasty way of copy pasting each and everything which would take so much of time and energy.

    To extract a table, create a new spreadsheet and enter the following expression in the top left cell:

    =ImportHtml(URL, "table", num)

    URL here is the URL of the page (between quotation marks), “table” is the tag to look for  and num is the number of the element, in case there are more on the same page.

    Once this is done, Google Docs retrieves the data and inserts it into the spreadsheet, including the headers. The last step is to download the spreadsheet as a CSV file.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: