|
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
Hi,
I'm trying to remote-control a site over which I have little control (it is a php app I installed on MY site, but I would like to leave it alone as much as possible). This app presents a series of forms to do various things. I can pre-fill the forms just manipulating the URL (*veeeery* long URLs, but it works). The problem: I still have to manually hit the [submit] button. Is there a way to force it programmatically? The form is a <form enctype="multipart/form-data" action="http:// 192.168.0.222/index.php?do=newtask& roject=2" method="post">and the button is a stupid <button accesskey="s" type="submit">Add this task</button> Can someone me, please? TiA Mauro |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
Mauro schreef:
> Hi, Hi Mauro, > I'm trying to remote-control a site over which I have little control > (it is a php app I installed on MY site, but I would like to leave it > alone as much as possible). > This app presents a series of forms to do various things. > I can pre-fill the forms just manipulating the URL (*veeeery* long > URLs, but it works). > > The problem: > I still have to manually hit the [submit] button. > Is there a way to force it programmatically? Post a form on a page you have before you? Hit the Enterbutton works on most browsers. I am not sure I can follow you however: You do not mind creating horrible URLs, but you DO mind pressing the submit button? Anyway, with a small modification in the page you can make it autosubmit via javascript. For example: index.php?do=newtask& roject=2&autosubmit= YThen from index.php: check if autosubmit is in the URL, and if it is, do something like: document.forms.myform.submit(); For that to work you must change your site of course. (You know: the one you didn't want to change.) Regards, Erwin Moller > > The form is a <form enctype="multipart/form-data" action="http:// > 192.168.0.222/index.php?do=newtask& roject=2" method="post">> and the button is a stupid <button accesskey="s" type="submit">Add > this task</button> > > Can someone me, please? > TiA > Mauro |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
Mauro wrote:
> I'm trying to remote-control a site over which I have little control Perl, and I am sure other languages as well, has the capability to submit information to a form on a web page that you do not have visible in a browser. |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
On 8 Apr, 16:14, Scott Bryce <sbr...@scottbryce.com> wrote:
> Mauro wrote: > > I'm trying to remote-control a site over which I have little control > > Perl, and I am sure other languages as well, has the capability to > submit information to a form on a web page that you do not have visible > in a browser. Thanks, that's exactly what I need. Do You have specific pointers? I would hate to browse hundreds of packages on CPAN only to discover I chose the wrong one. TiA Mauro |
|
|
|
#5 (permalink) |
|
Messages: n/a
Hébergeur: |
Mauro <ZioByte@gmail.com> writes:
> On 8 Apr, 16:14, Scott Bryce <sbr...@scottbryce.com> wrote: >> Mauro wrote: >> > I'm trying to remote-control a site over which I have little control >> >> Perl, and I am sure other languages as well, has the capability to >> submit information to a form on a web page that you do not have visible >> in a browser. > > Thanks, > that's exactly what I need. > Do You have specific pointers? > I would hate to browse hundreds of packages on CPAN only to discover I > chose the wrong one. LWP is the low-level mechanism for web client programming, and supports a variety of protocols. WWW::Mechanize uses LWP, and adds higher-level capabilities like parsing and submitting forms, maintaining a jar for multi-page "session ", and more. One hurdle to using these tools is that they're *not* JavaScript-aware. If you want to "drive" a site that relies on JS, you'll have to examine it to see what effect (if any) the JS has on the submitted data, then duplicate that effect in your Perl code. sherm-- -- My blog: http://shermspace.blogspot.com Cocoa programming in Perl: http://camelbones.sourceforge.net |
|
![]() |
| Outils de la discussion | |
|
|