I’m using httpry to pull http packets from an interface on my machine. It outputs the results in a very clean format, with columns that are separated by either spaces or tabs. Here’s a sample line from the output.
2012-11-27 20:29:22 192.168.1.132 74.125.224.51 > GET www.google.com / HTTP/1.1 - -
I’m trying to write a script (in either bash or python) that grabs the website, in this case http://www.google.com, and writes them to a file. Writing them to a file is easy enough, but I don’t have any experience parsing based on white space or tabs. If anyone could get me pointed in the right direction on how to do this, that’d be great. Thanks for the help.
It seems to me that
awkis the tool for the job here (from within a bash script):