Re: [Tutor] Controlling applications

2008-06-11 Thread Eike Welk
On Monday 09 June 2008 17:51, W W wrote:
> Hi,
>
> I've done some cursory searches, and it doesn't appear that what I
> want to do is popular, if it's even possible.
>
> I'm trying to control other applications via python (specifically
> my web browser).
>
> My hope is there is some way to emulate a series of keypresses. My
> goal is to have a script that will automatically retrieve my
> banking information. Originally I was planning to use urllib to
> post/retrieve the data, but as far as I can tell, the bank uses
> several variables and some javascript to authenticate everything,
> and it seems overly complicated to try and manually figure it all
> out.
>
> Is there a way to utilize python to perform keypresses? And does
> anyone know of a tutorial for such a thing? I'm running the most
> recently updated Ubuntu 8.04.
>
> TIA, Wayne

This discussion might be interesting for you:
http://holovaty.com/blog/archive/2008/05/02/0136

HTH,
Eike.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Controlling applications

2008-06-10 Thread Chris Fuller
On Monday 09 June 2008 14:13, Alan Gauld wrote:
> You need to find an API that lets you work at the X windows
> protocol level. I don;t know of one but will be surprised if
> there isn't such a beast around somewhere!

This made me think of Tcl's send() function.  This web page has some links 
that may (or not) be useful:

http://wiki.tcl.tk/1055

Cheers
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Controlling applications

2008-06-09 Thread Jeff Younker

On Jun 9, 2008, at 8:51 AM, W W wrote:

Originally I was planning to use urllib to post/retrieve
the data, but as far as I can tell, the bank uses several variables
and some javascript to authenticate everything, and it seems overly
complicated to try and manually figure it all out.


Raw urllib is a poor way to interact with web sites;  it's too low
level.  Instead you might consider the libraries mechanize and
twill.  They are essentially web browsers in a library.  They won't
handle JavaScript, but they do let you retrieve, fill in, and send
forms without worrying much about the details of the conversation.

You might give them a try before completely giving up on the
command line mechanisms.

Alas controlling applications is very hard in Unix land and
very easy in the Windows world.

-jeff

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Controlling applications

2008-06-09 Thread Kent Johnson
On Mon, Jun 9, 2008 at 3:26 PM, Michael Langford
<[EMAIL PROTECTED]> wrote:
> You're looking for mechanize
> http://wwwsearch.sourceforge.net/mechanize/

Possibly but mechanize emulates a browser, it doesn't control one,
which the OP specifically rejected as an option...

Kent

>> Originally I was planning to use urllib to post/retrieve
>> the data, but as far as I can tell, the bank uses several variables
>> and some javascript to authenticate everything, and it seems overly
>> complicated to try and manually figure it all out.
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Controlling applications

2008-06-09 Thread Michael Langford
You're looking for mechanize
http://wwwsearch.sourceforge.net/mechanize/

On Mon, Jun 9, 2008 at 11:51 AM, W W <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've done some cursory searches, and it doesn't appear that what I
> want to do is popular, if it's even possible.
>
> I'm trying to control other applications via python (specifically my
> web browser).
>
> My hope is there is some way to emulate a series of keypresses. My
> goal is to have a script that will automatically retrieve my banking
> information. Originally I was planning to use urllib to post/retrieve
> the data, but as far as I can tell, the bank uses several variables
> and some javascript to authenticate everything, and it seems overly
> complicated to try and manually figure it all out.
>
> Is there a way to utilize python to perform keypresses? And does
> anyone know of a tutorial for such a thing? I'm running the most
> recently updated Ubuntu 8.04.
>
> TIA, Wayne
>
> --
> To be considered stupid and to be told so is more painful than being
> called gluttonous, mendacious, violent, lascivious, lazy, cowardly:
> every weakness, every vice, has found its defenders, its rhetoric, its
> ennoblement and exaltation, but stupidity hasn't. - Primo Levi
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Controlling applications

2008-06-09 Thread Alan Gauld


"W W" <[EMAIL PROTECTED]> wrote


I'm trying to control other applications via python (specifically my
web browser).


The webbrowser module will maybe give you a start?


My hope is there is some way to emulate a series of keypresses.


I know how to do that in Windows but not in Linux!


Is there a way to utilize python to perform keypresses? And does
anyone know of a tutorial for such a thing? I'm running the most
recently updated Ubuntu 8.04.


You need to find an API that lets you work at the X windows
protocol level. I don;t know of one but will be surprised if
there isn't such a beast around somewhere!

If you could use a text based browser like lynx it would probably
be easier since you could work at the terminal or curses level.

Sorry I can't help more,

Alan G.



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor