Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: How to get DOM from currently open IE browser.

by dadto7 (Novice)
on Nov 07, 2007 at 15:23 UTC ( [id://649499]=note: print w/replies, xml ) Need Help??


in reply to Re: How to get DOM from currently open IE browser.
in thread How to get DOM from currently open IE browser.

Thanks for your reply and the link is great. I've used some of that before where I can get things from various windows and use the Clipboard to manipulate the data.

Unfortunately, I do not see how this can help be get things out of the HTML/DOM. Let's say I want to get the value from a SPAN id named "Errorcnt". In JavaScript it would look something like "document.getElementById('Errorcnt').innerHTML". This is why I feel that I'll have to use the Win32::OLE package stuff.

Did you have a Win32:GuiTest method in mind that would do that?

THX, Nick.

  • Comment on Re^2: How to get DOM from currently open IE browser.

Replies are listed 'Best First'.
Re^3: How to get DOM from currently open IE browser.
by technojosh (Priest) on Nov 07, 2007 at 15:41 UTC
    I saw some examples on the web but they all seem to open new IE windows and that does not help me. I need to get to windows that are already open.

    My suggestions were for your above issue, those methods I mentioned would help to get you to an IE window that is already open...I apologize if I misread your question.

      Sorry, maybe I misunderstood what methods you meant. I have used the Win23::GuiTest methods to successfully get the window active/foreground. You can get some rudimentary info like URL, and Window title using the examples I've seen on the net. But no examples I've seen get the innerHTML (See the JavaScript sample in my previous reply to see the type of data I hope to retrieve). A Win32::OLE example would look like below. But the GetActiveObject does not seem to work and that is my real problem.
      my $currDir = cwd; my $url = "file://" . $currDir . "/osmerrors1.html?5,now"; my $IE; $IE = Win32::OLE->GetActiveObject( "InternetExplorer.Application" ); $IE->Navigate($url , 4 ); my $IEurl = $IE->Document->URL;

      But I have not seen any examples yet where you can get to the HTML which is what I need. That is why I asked for the specific method you think will do that and I can try those.

      BTW, you may have noticed this is my first question here so I need to figure out how you got the stuff in italics at the beginning of you last reply. Did you just cut and paste that and surround it with the "code" stuff?

      THX, Nick

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-23 06:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found