in reply to Reading from an ActiveX Object

Give us more context. In general if you can do it from VB or VB script you can do it from Perl. How you do it depends on what it is you are actually trying to do.


Perl is environmentally friendly - it saves trees

Replies are listed 'Best First'.
Re^2: Reading from an ActiveX Object
by GaijinPunch (Pilgrim) on Jul 08, 2008 at 05:12 UTC
    Hi:

    Well, here's the site I'm trying to read from:
    http://www.jp.playstation.com/software/

    As you'll notice, the item index is generated within an ActiveX object. I would basically like to read from there and get the pertinent info. Each item's title, release date, publisher.

    I did search through CPAN but what I looked at all seemed server side. A point in the right direction would be very appreciated.

      ActiveX is always client side - it is code that runs on your system. My Japanese is nonexistent so I can't easily determine what you are trying to retrieve. Try looking at the page source in your browser to see if the information you want is buried there somewhere.


      Perl is environmentally friendly - it saves trees
        >>ActiveX is always client side See, that shows you how awful I am. :)

        Already looked... definitely not there. Hence, I asked here. :) Even without speaking Japanese you can get the gist of the site. ActiveX Object loads, displays index. If you click one of the next or previous page links, only the ActiveX object updates... the page doesn't reload. The guts of the page are summed up in a few Javascript() routines. It sets start to increment * page number, checks the form for any newly selected checkboxes, then runs the following.
        function change(url) { document.getElementById('RESULT').innerHTML = '<br><br><br><br +><br><br><br><center><img src="img/loading.gif"></center>'; Initialize(); if(req != null) { req.onreadystatechange = Process; req.open("GET", url,true); req.send(null); }; } // ------------------------------ // Initialize(ajax) // ------------------------------ function Initialize() { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(oc) { req = null; } } if(!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); } };
        There's a little more to it than that, but that's generally it. I guess the idea would be to open the same ActiveX object with a Perl Module that my browser is opening?

      If you use firefox with the firebug plugin you can trace request made via the XMLHttpRequest object(probably the ActiveX component in question on IE). Doing so I was able to find the content of the search at this url:

      http://www.jp.playstation.com/software/search.cgi?ITEM_NAME=& FORMAT_PS3=0&SORT=1&START=&FORMAT_PSP=0&FORMAT_PS2=0&FORMAT_PS=0& JP_GENRE_CODE=&MAKER_CODE=&START_YM=&END_YM=&ONLY_DISC=0& ONLY_ONLINE=0&BEST_FLAG=0&ARCHIVES=0&ON_SALE=1

      If you twiddle some of the URL params you should be able to mimic the search criteria you are looking for.