Jump to content

String manipulation


Recommended Posts

Hi guys, I'm trying to parse the information being shown in on mouse over in a webpage. My script uses a lot of the _IE functions and I can't figure out how to get the content of the onmouseover="" function.

<a id="link1" class="mainNav" onmouseover="showTooltip('<div><br/>the sky is blue today</div><div>The sky will be green tomorrow.</div>',this,event,'weatherwindow');return false;">linky</a>

So essentially I'm trying to retrieve: showTooltip('<div><br/>the sky is blue today</div><div>The sky will be green tomorrow.</div>',this,event,'weatherwindow');return false;

I've tried .onmouseover thinking it would work like .className, but it returns an empty value. I'm i missing something?

$o = _IEGetObjByName($oIE, $link1)
$oClass = $o.className ; that works
$oonmouseover = $o.onmouseover ; that doesn't work

Thanks in advance for any help you can provide.

- Cascius

Link to comment
Share on other sites

Why not using _InetGetSource and then just parse the source?

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

I can't figure out how to get the content of the onmouseover="" function.

As Xenobiologist suggested, try to use _InetGetSource function, something similar to this:

#include <INet.au3>
$link="http://here.goes.the.url"
$result=_INetGetSource($link)
$result=StringRegExpReplace($result,'.*onmouseover="(.*)".*',"$1")
ConsoleWrite('$result = ' & $result & @CRLF)

Cheers,

sahsanu

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...