Jump to content

IE - Capture Select Text


Recommended Posts

I don’t want to be different so I’ll admit I am very new to AutoIt. I’ve been able to do cool stuff so far and the forums have helped every bit of the way. The one thing I have not been able to do so far is capture select text from a webpage.

Using _IE_Example 'basic' as an example – I only want to capture the text from div id=line1 and div id=line3

<HEAD>
<TITLE>_IE_Example('basic')</TITLE>
<STYLE>body {font-family: Arial}</STYLE>
</HEAD>
<BODY>
<a href='http://www.autoitscript.com'><img src='http://www.autoitscript.com/images/autoit_6_240x100.jpg' name='AutoItImage' alt='AutoIt Homepage Image'></a>
<p>
<div id=line1>This is a simple HTML page with text, links and images.</div>
<p>
<div id=line2><a href='http://www.autoitscript.com'>AutoIt</a> is a wonderful automation scripting language.</div>
<p>
<div id=line3>It is supported by a very active and supporting <a href='http://www.autoitscript.com/forum/'>user forum</a>.</div>
<p>
<div id=IEAu3Data></div>
</BODY>
</HTML>

I tried using _IEGetObjByName and _IEGetObjById but I no data is returned.

#include <IE.au3>
Local $oIE = _IE_Example("basic")
Local $oDiv = _IEGetObjByName($oIE, "line1")
MsgBox(0, "Body Text", $oDiv)

or

#include <IE.au3>
Local $oIE = _IE_Example("basic")
Local $oDiv = _IEGetObjById($oIE, "line1")
MsgBox(0, "Body Text", $oDiv)

Any help would be appreciated.

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...