Way to select HTML tables by column and add them to the pasteboard?
Solution 1:
As far as I know, there's no way to do that in Safari or Chrome, but in Firefox you can select ranges of cells by holding option and command.
You could also copy the whole table and paste it to a spreadsheet application or use something like pbpaste | cut -d $'\t' -f3
. But it might not work if there are cells that contain br elements or rows that start with empty cells.
I've had to use something like this with a few tables that contained br elements:
ruby -e '`pbpaste`.scan(/<tr>.*?<\/tr>/m).each { |r| puts r.scan(/<td>(.*?)<\/td>/m)[2] }'