Hello,
I have searched and searched to no avail... not surprising, I'm doing some kinda weird stuff.
I'm using Win32::OLE for this. Basically, what I want is the document object (IHTMLDocument2 Interface, http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/document2/document2.asp) but I need to get it from frames. I can get it fine from NON-frames.
First, here's the error. BTW, I only see this on some PCs, not all. I have 4 that are working and 3 not.
Uncaught exception from user code:
OLE exception from "<Unknown Source>":
Invalid access to memory location.
Win32::OLE(0.1702) error 0x80020009: "Exception occurred"
in METHOD/PROPERTYGET "document" at C:\Scripts\this.pl line 69 at C
+:/Perl/site/lib/Win32/OLE/Lite.pm line 216
Win32::OLE::Tie::FETCH('Win32::OLE::Tie=HASH(0x1c0e754)', 'docu
+ment') called at C:\Scripts\this.pl line 69
And now a code snippet:
(everything before this is reused a lot, and works fine... and is broken up into multiple modules that will mean nothing unless I post the modules)
my $IEDoc = $IEWin->{Document};
my $frames = $IEDoc->{frames};
my %frameshash;
for (my $i = 0; $i < $frames->{length}; $i++)
{
$frameshash{$frames->{$i}->{name}} = $frames->{$i};
}
foreach my $key ( keys( %frameshash ) )
{
print "\n".$key."\n";
print $frameshash{$key}->{document}->{body}->{innerHTML}."\n";
}
The line, specifically, that is crapping out is the 2nd to last, where I attempt to print innerHTML. The reason being, I CANNOT access the document portion.
Any help would be appreciated, thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.