views:

65

answers:

1

I'm using WWW::Mechanize to retrieve a webpage. I need to check if the page has been updated and retreive information from it. How can I do this?

+3  A: 

Use the mirror method. This works fine for GET requests, see the method attribute of the form element which you are submitting. Just take note of the URI where you arrived, use it to repeatedly call mirror. Then there is no need to fill and submit the form anymore.

In the case of POST, you are not able to leverage any assistance from the HTTProtocol (conditional requests, ETags and other cacheability features). You have to manually write out fetched results to files, then compare them.

daxim
Here's my problem..the page I want to mirror is obtained through submit_form. How do I mirror that?
Rajesh
You should have mentioned this important part in the question. I added some more text to my answer to deal with the form complication.
daxim