[Tutor] Have Python Update Forms
Kent Johnson
kent37 at tds.net
Fri Jun 6 02:43:30 CEST 2008
On Thu, Jun 5, 2008 at 1:56 PM, James <jtp at nc.rr.com> wrote:
> I want to write a program that will update the 'last updated' field on
> *every* item. This will require some sort of 'post' to the web server
> and interaction with the existing web tools and its back-end. I can
> probably whip up a program (using the advice Kent gave yesterday in a
> thread on this mailing list :)) to gather the entire list of items
> that needs to be modified (all the to-do list item numbers, that is).
> I'm not sure, however, how to mimic manually updating the last-updated
> field.
You have to find out how the browser talks to the backend. Most likely
it is a POST with the form data. If so, you can simulate this in
Python. See the section on POST here:
http://personalpages.tds.net/~kent37/kk/00010.html
There are various complications - authentication, hidden fields and
JavaScript, for example - but essentially you want to write a Python
program that mimics the interaction the browser has with the server.
Tools that let you inspect the browser interaction are very helpful
but I will leave you to ferret those out yourself. There are Firefox
plugins that will do that.
Kent
More information about the Tutor
mailing list