Jump to content

_IEDocWriteHTML and search function


 Share

Recommended Posts

#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
Link to comment
Share on other sites

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>")

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...