Mouse Posted December 24, 2012 Share Posted December 24, 2012 Well, i have been using autoit for about 2 years now. I find it very fun and all, but i was never able to fully grasp the concept of _IE. Basically... my program will open up a webpage and then after the webpage is loaded and all, i will press another button which will search for text inside that webpage and then replace that text. Anyhelp please? I can show some source of what i have done already expandcollapse popup#include #include <ButtonConstants.au3> #include <EditConstants.au3> #include <IE.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Local $oIE = _IECreateEmbedded() $Form1 = GUICreate("LOL", 819, 668, 186, 114) $Input1 = GUICtrlCreateInput("", 0, 0, 817, 21) $Button1 = GUICtrlCreateButton("Button1", 0, 584, 193, 81) $Button2 = GUICtrlCreateButton("Button2", 200, 584, 185, 81) $Button3 = GUICtrlCreateButton("Button3", 392, 584, 185, 81) $Button4 = GUICtrlCreateButton("Button4", 584, 584, 233, 81) $Pic1 = GUICtrlCreateObj($oIE, 0, 24, 817, 561) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 $sText = _IEBodyReadText($oIE) If StringInStr($sText, "StringToReplaceHere") Then ;;; I found it Msgbox(1,"Found it","Yay, i found it.") StringReplace($sText,"","Replaced") Else ;;; didn't find it ;;; do something else EndIf Case $Button1 _IENavigate($oIE,"WEBSITEHERE") EndSwitch WEnd Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 24, 2012 Share Posted December 24, 2012 Maybe one of these functions helps you out - _IEBodyWriteHTML, _IEDocInsertHTML, _IEDocInsertText, _IEDocWriteHTML. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Mouse Posted December 24, 2012 Author Share Posted December 24, 2012 Maybe one of these functions helps you out - _IEBodyWriteHTML, _IEDocInsertHTML, _IEDocInsertText, _IEDocWriteHTML.What im trying to figure out is how i'm going to use this line"StringReplace($sText,"","Replaced")"When i do it, it don't replace it Link to comment Share on other sites More sharing options...
Xandy Posted December 24, 2012 Share Posted December 24, 2012 (edited) ;stringreplace() returns the string with replacements ;so $new_string= stringreplace($sText, "match_string", "replacement_string") Edited December 24, 2012 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
DaleHohm Posted December 24, 2012 Share Posted December 24, 2012 _IEBodyReadText reads and makes a copy of the text in a webpage. If you alter it, nothing happens to the webpage - it is a copy. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
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