I am trying to automate the process of getting the nine digit zip code from the US Postal service web site (http://zip4.usps.com/zip4/welcome.jsp) To do so I need the message sent when I click on the Submit button at that site. Is this a facility provided by WireShark? Thanks, Jim asked 29 Nov '10, 08:07 Jim |
One Answer:
No, Wireshark cannot script the retrieval process for you. That is something you might do using wget or some other tool that fetches web pages. Wireshark can help you to get the wget request right though: capture a manual search that works, and then work with the wget parameters until your automated request matches the manual one when you capture it. This should then give you the results as you need them. You might look into something like "wget http://zip4.usps.com/zip4/zcl_0_results.jsp --post-data [your query parameters]", because the web page expects the form to be submitted by POST operation. Good luck :-) answered 29 Nov '10, 09:07 Jasper ♦♦ |
Thanks Jasper. I'm not sure I make myself clear--my bad.
I have no trouble fetching web pages for which I have the url. My problem is feeding the USPS the info that is sent via the SUBMIT button on their site. I need to know what it is that I should POST to the USPS site: url "http://zip4.usps.com/zip4/zcl_0_results.jsp" so that that site will return the 9 digit zip code--actually the himl source code from which I can parse out the zip code.
Is that a little clearer?
Jim
Yes, it is. This is what you can use Wireshark for, which is what I meant by capturing manual search: start Wireshark, capture on the network card that you are going to use to fetch the web page manually, and after you run the manual process, stop the capture. Then you need to find the POST request that you made to the page, for example by filtering for http.request.method=="POST". You should then be able to find the packet containing your POST request. Take a look at the decode of that packet: in the last section you can unfold the details of your request, including all name/value pairs.