Jump to content
Sign in to follow this  

Please help me to get IE Text

Recommended Posts

I want to navigate to all the links in a web page and save the text. I Can not run the script below. Can you please tell me How can I do?

Code AutoIt

#include <IE.au3>

$target = InputBox("Save as Text", "enter file name:")

$target = @ScriptDir & "\" & $target

$sUrl = InputBox("Save to Text", "Enter URL:")

$file = FileOpen($target, 2)

$oIE = _IECreate($sUrl, 0, 1, 1)

$oLinks = _IELinkGetCollection($oIE)

$iNumLinks = @extended

For $oLink in $oLinks

_IENavigate($oIE, $oLink.href, 1)

If @error Then

MsgBox(0, "Error to netvigate!", @error)



$sText = _IEBodyReadText ($oIE)

If @error Then

MsgBox(0, "get text error", @error & " " & @extended)



FileWrite($file, $sText)

FileWrite($file, @CRLF)




MsgBox(0, "finish", "Opened " & $iNumLinks & " links.")


Share this post

Link to post
Share on other sites


your code worked for me?

it follows links and writes text into file ..

add some more msgbox() to figure out what you get on what point..

do you use the latest version 3.22??

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...