Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Win32::OLE VBA to Perl Translation Question about Internet Explorer (solution)

by ikegami (Patriarch)
on Jan 17, 2007 at 17:55 UTC ( [id://595108]=note: print w/replies, xml ) Need Help??


in reply to Win32::OLE VBA to Perl Translation Question about Internet Explorer

[ This post is the a continuation of my previous work on the subject. ]

Solved!!

Right from the start, I was dismayed at the lack of documentation of PostData's type. (Saying Variant is totally meaningless.) After lots of research, I found how to format the data to IE's liking.

use strict; use warnings; use Win32::OLE qw( ); use Win32::OLE::Variant; # qw( Variant VT_* ); my $IE = Win32::OLE->new("InternetExplorer.Application") or die("Could not start Internet Explorer.Application\n"); $IE->{visible} = 1; my $url = "http://amos.shop.com/amos/cc/main/ccn_search/ccsyn/15 +0/stid/6150608"; my $post_data = "search_form=&st=socks&sy=products&search_button.x=39& +search_button.y=12"; $IE->Navigate( $url, undef, undef, Variant(VT_UI1, $post_data), "Content-Type: application/x-www-form-urlencoded\r\n", ); # Alternative Syntax # ================== # # $IE->Navigate($url, { # PostData => Variant(VT_UI1, $post_data), # Headers => "Content-Type: application/x-www-form-urlencoded\r\n" +, # });

The CGI script I used for debugging returned:

REQUEST_METHOD=POST CONTENT_LENGTH=71 CONTENT_TYPE=application/x-www-form-urlencoded Content length: 71 Content (hex): 7365617263685f666f726d3d2673743d736f636b732673793d7072 +6f6475637473267365617263685f627574746f6e2e783d3339267365617263685f627 +574746f6e2e793d3132 Content: search_form=&st=socks&sy=products&search_button.x=39&s +earch_button.y=12

Replies are listed 'Best First'.
Re^2: Win32::OLE VBA to Perl Translation Question about Internet Explorer (solution)
by sailortailorson (Scribe) on Jan 17, 2007 at 19:56 UTC
    Ikegami,

    Thank you very, very much. You are a very kind monk. This will help other people beside me too.

    Also, thanks to bart, tye, corion, jdporter and wfsp.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://595108]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-12-14 16:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (70 votes). Check out past polls.