19

I'm looking for a way to filter tables often found in Wikipedia articles, so I can compare only the rows (and columns) I'm interested in.

Is there either

  1. a built-in feature in the Wikipedia engine that I'm not aware of
  2. or a browser plugin that supports this

The features I can think of are:

  • Filter by column value
  • Hide columns
  • Multilevel sorting
1
  • Ahhh... the off-topic minefield. See point 3 in the first table. I'm asking for something specific to Wikipedia. In fact a Greasemonkey script would do, but haven't been able to find one
    – pufferfish
    Commented Aug 7, 2014 at 11:08

3 Answers 3

12

If you place this formula in a cell within Google Sheet, it will scrape the tabular data from this Wikipedia article link: http://en.wikipedia.org/wiki/Demographics_of_India

=IMPORTHTML("http://en.wikipedia.org/wiki/Demographics_of_India", "table", 4)

Once you have the data within Google Sheet, you can filter by column value (select column header, choose Filter from Data menu) & hide column (select column, choose Hide column from context menu)

Google Sheets screen shot

2
  • You can also just copy and paste it into Sheets.
    – Laurel
    Commented Apr 23, 2023 at 23:07
  • Yes, the tabular data can be copy-pasted but if the data is dynamic, using a formula may be a better option. Bookmarklets like this one can also manipulate data within tables directly on the source web page - phpied.com/reactivetable-bookmarklet
    – mvark
    Commented Aug 24, 2023 at 9:26
5

The Wikipedia Table filter Greasemonkey script does what you want:

Script Summary: Filters wikipedia tables by removing all rows that have an undesired value, or by deleting certain rows and columns.

You may need to add the https version of the wikiedia URL to the script's included pages filter list to get it to work.

0

Tables? Do you mean the infoboxes? You should probably use Wikidata http://wikidata.org/w/api.php and extract the information from there (it will be cleaner), then present it how you prefer.

Otherwise, you can sprinkle display: none everywhere on appropriate IDs and classes for the tables in question, but it's going to be an endless chase of unstructured information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.