I have investigated WWW::Scripter and been in communication with that library's author, Father Chrysostomos. But this is proving a tough nut to crack. Let me give another example:

Slightly obfuscated and simplified source code:
$ cat source.html <html> <head></head> <body> <script src="http://bs.example.com/SmashingPumpkin/adServer.bs?cn=rsb&c=28&pli +=8064559&PluID=0&w=336&h=280&ord=[RANDOM_NUMBER]&ucm=true"></script> <noscript> <a href="http://bs.example.com/SmashingPumpkin/adServer.bs?cn=brd&FlightI +D=8064559&Page=&PluID=0&Pos=1510952713" target="_blank"><img src="http://bs.example.com/SmashingPumpkin/adServer.bs?cn=bsr&FlightID +=8064559&Page=&PluID=0&Pos=1510952713" border=0 width=336 height=280></a> </noscript> </body> </html>

What I see in Safari Web Inspector (trimmed, obfuscated)

$ cat formatted.html <html><head></head> <body> <script src="http://bs.example.com/SmashingPumpkin/adServer.bs?cn=rsb&amp;c=28 +&amp;pli=8064559&amp;PluID=0&amp;w=336&amp;h=280&amp;ord=[RANDOM_NUMB +ER]&amp;ucm=true"></script> <div id="ebDiv850954202003777" dir="ltr" style="display: inline; width: 336px; height: 280px; margin: 0px auto; "> <div id="ebStdBannerDiv_16672157_850954202003777" dir="ltr" style="border: 0px; padding: 0px; margin: 0px; top: 0px; left: 0px; overflow: visible; font-size: 0px; line-height: 0px; text-align: left; width: 336px; height: 280px; display: inline; "> <object id="ebStdBannerFlash_16672157_850954202003777" dir="ltr" name="ebStdBannerFlash_16672157_850954202003777" style="border:0px; padding:0px; margin:0px; text-align:left +; width:336px; height:280px; " codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swfl +ash.cab#" version="8,0,0,0" type="application/x-shockwave-flash" data="http://ds.example.com/BurstingRes//Site-23100/Type-2/9bcc2f07-af +05-4f07-a0f0-ca803d331bd4.swf"> ...

My object is to be able to pluck out either of the last two lines -- 'type' or 'data' -- you see above.

Using WWW::Scripter, I called:

$scripter->use_plugin("JavaScript"); my $doc = $scripter->document(); say STDERR Dumper $doc;
The latter call resulted in 23,500+ lines in Data::Dumper output -- yet nowhere in there could I find the strings 'swf', 'shockwave' or 'flash'. So I couldn't be sure if the code was executing the script at all.

Suggestions?

Thank you very much.

Jim Keenan


In reply to Re: Seek Perl equivalent to DOM Inspector by jkeenan1
in thread Seek Perl equivalent to DOM Inspector by jkeenan1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.