Jump to content
Sign in to follow this  
£åߥ®Ñth

Question, _IEBodyReadText

Recommended Posts

£åߥ®Ñth

#include <IE.au3>
$oIE = _IECreate ("www.google.com")
$sText = _IEBodyReadText ($oIE)
MsgBox(0, "Body Text", $sText)

Ok this reads very nicely,

Now how would i go about just getting for example "Books" to display only?

I have looked around for 2 days using search and trying all kinds of stuff, im not sure what to look for really or how to ask.

Can someone show a small example or what i need to look at?

Share this post


Link to post
Share on other sites
Valuater

This is from "Welcome to Autoit 1-2-3"

; demonstration to find chracters that change between to standard points
; or just find a string
#include <IE.au3>
#include <String.au3>

#Region --- IE-Builder generated code Start ---

$oIE = _IECreate()

;------------- User input --------------
_IENavigate($oIE, "http://www.autoitscript.com/") ; web address
$Find = "Welcome to the "  ; my info shows after this line... or just find this line
$Before = "- the home "     ; my info shows before this line... or set as ""
; ------------ End User input -------------
Sleep(1000)
$body = _IEBodyReadHTML($oIE)
$sloc = @TempDir & "\stest.txt" 
FileDelete($sloc)
FileWrite($sloc, $body)
$sfile = FileOpen($sloc, 0)
$num = 0
While 2
    $num = $num + 1
    $sline = FileReadLine($sfile, $num)
    If @error Then
        MsgBox(262208, "Fail", "The string was NOT found   ")
        FileClose($sfile)
        Exit
    EndIf
    If StringInStr($sline, $Find) Then
        MsgBox(64, "Success", "The string *" & $Find & "* was found    " & @CRLF & " on line # " & $num, 5)
        If $Before = "" Then ExitLoop
        $Found = _StringBetween($sline, $Find, $Before)
        MsgBox(64, "Found", "The string is *" & $Found[0] & "*    ", 5)
        ExitLoop
    EndIf
WEnd

#EndRegion --- IE-Builder generated code End ---

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
£åߥ®Ñth

I want to thank you for this, and now i have "Welcome to Autoit 1-2-3" as well.

You do not know how much trouble i have had with this :S.

I have been tinkering with autoit on and off but never _IE stuff at all.

You have made my day mate thank you again....

Edited by £åߥ®Ñth

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.