jmooney70 Posted April 6, 2012 Posted April 6, 2012 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.
ileandros Posted April 6, 2012 Posted April 6, 2012 try this #include <IE.au3> $oIE = _IE_Example("basic") $oDiv = _IEGetObjByName($oIE, "line1") $propr = _IEPropertyGet($oDiv, "innertext") MsgBox(0, "Body Text", $propr) I feel nothing.It feels great.
jmooney70 Posted April 7, 2012 Author Posted April 7, 2012 Thanks ileandros! That works and I am off and running again.
efi Posted April 8, 2012 Posted April 8, 2012 (edited) Sorry, posted in the wrong place. Edited April 8, 2012 by efi
somdcomputerguy Posted April 8, 2012 Posted April 8, 2012 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now