Sign in to follow this  
Followers 0
jmooney70

IE - Capture Select Text

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



Thanks ileandros! That works and I am off and running again.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Sorry, posted in the wrong place.

Edited by efi

Share this post


Link to post
Share on other sites

The _IEBodyReadText function may be useful as well.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
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
Sign in to follow this  
Followers 0