Jump to content
maniootek

_IEDocWriteHTML and search function

Recommended Posts

maniootek
#include <IE.au3>

Local $oIE = _IECreate()
Local $sHTML = "<!DOCTYPE html>"
$sHTML &= "<HTML>" & @CRLF
$sHTML &= "<HEAD>" & @CRLF
$sHTML &= "<TITLE>Example</TITLE>" & @CRLF
$sHTML &= "</HEAD>" & @CRLF
$sHTML &= "<BODY>" & @CRLF
$sHTML &= "<p>try to use ctrl+f to find this text</p>" & @CRLF
$sHTML &= "</BODY>" & @CRLF
$sHTML &= "</HTML>"

_IEDocWriteHTML($oIE, $sHTML)
_IEAction($oIE, "refresh")

Search function does not match any text from the IE body. Any suggestions?

 

ie_search.png

Edited by maniootek

Share this post


Link to post
Share on other sites
maniootek
7 minutes ago, JohnOne said:

Get rid of

_IEAction($oIE, "refresh")

 

same result as before

Share this post


Link to post
Share on other sites
maniootek

What you mean? As you can see, searching sentense is inside the <body></body> tag

body.png

Share this post


Link to post
Share on other sites
maniootek

I will answer myself. To make it work you just have to put your body html into frameset:

#include <IE.au3>

Local $oIE = _IECreate()
Local $sHTML = "<!DOCTYPE html>"
$sHTML &= "<HTML>" & @CRLF
$sHTML &= "<HEAD>" & @CRLF
$sHTML &= "<TITLE>Example</TITLE>" & @CRLF
$sHTML &= "</HEAD>" & @CRLF
$sHTML &= "<FRAMESET>" & @CRLF
$sHTML &= "<FRAME name=main src=about:blank>" & @CRLF
$sHTML &= "</FRAMESET>" & @CRLF
$sHTML &= "</HTML>"

_IEDocWriteHTML($oIE, $sHTML)
Local $oFrameMain = _IEFrameGetObjByName($oIE, "main")
_IEBodyWriteHTML($oFrameMain, "<p>try to use ctrl+f to find this text</p>")

 

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

×