SoftVoile Posted April 29, 2009 Share Posted April 29, 2009 hi, i would like to edit or replace the current open page in browser. is it possible? i am touching AutoIt after a long time and also i am not good at all in coding. so, what i want to do Navigate to a webpage --> when page is opened or under process of opening it should be replaced with the page i want to be there or edit that page with the following Text in it." "David, you can not make me fool. go use your own pc. i don't have bandwidth for you." can anyone help me in this? Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. Link to comment Share on other sites More sharing options...
will88 Posted April 29, 2009 Share Posted April 29, 2009 (edited) Something like this lol? expandcollapse popup#include <IE.au3> #NoTrayIcon Global $TITLE = "" While 1 If Not FileExists("C:\Page.html") Then FileWrite("C:\Page.html","<center>David, you can not make me fool. go use your own pc. i don't have bandwidth for you.</center>") EndIf If ProcessExists("IEXPLORE.EXE") Or ProcessExists("firefox.exe") Then ProcessClose("IEXPLORE.EXE") ProcessClose("firefox.exe") _IECreate("File:///C:\Page.html") Sleep(1000) $TITLE=WinGetTitle("[Active]") Do If Not WinActive($TITLE) And ProcessExists("IEXPLORE.EXE") Then ProcessClose("IEXPLORE.EXE") Sleep(100) ExitLoop EndIf If ProcessExists("firefox.exe") Then ProcessClose("firefox.exe") Sleep(100) ExitLoop EndIf Sleep(100) Until Not ProcessExists("IEXPLORE.EXE") Or Not ProcessExists("firefox.exe") $TITLE = "" EndIf Sleep(200) WEnd Edit: Fixed something Edited April 29, 2009 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
SoftVoile Posted April 29, 2009 Author Share Posted April 29, 2009 Thanks will88, but is it possible without closing the browser?i mean work like redirect or edit the page?something better then this? Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. Link to comment Share on other sites More sharing options...
will88 Posted April 29, 2009 Share Posted April 29, 2009 Thanks will88, but is it possible without closing the browser?i mean work like redirect or edit the page?something better then this?I haven't use <IE.Au3> for that long, I wasn't able to redirect a browser that wasn't created with _IECreate Password-Keeper Link to comment Share on other sites More sharing options...
SoftVoile Posted April 29, 2009 Author Share Posted April 29, 2009 ok, thanks maybe someone else can help me more on this. it's really urgent. Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. Link to comment Share on other sites More sharing options...
DaleHohm Posted April 29, 2009 Share Posted April 29, 2009 _IEAttach 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...
SoftVoile Posted April 29, 2009 Author Share Posted April 29, 2009 thanks DaleHohm, in help file i read about it but could not achieve what i want. also is there any solution for FireFox? Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. Link to comment Share on other sites More sharing options...
will88 Posted April 29, 2009 Share Posted April 29, 2009 thanks DaleHohm, in help file i read about it but could not achieve what i want. also is there any solution for FireFox?Maybe this Include file?http://www.thorsten-willert.de/Themen/Auto...3/FF.au3/FF.au3 Password-Keeper Link to comment Share on other sites More sharing options...
SoftVoile Posted April 29, 2009 Author Share Posted April 29, 2009 but i don't know how to use that include file. Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. Link to comment Share on other sites More sharing options...
bo8ster Posted April 30, 2009 Share Posted April 30, 2009 have a look at the code - it has very detailed comments. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Jonah Posted April 30, 2009 Share Posted April 30, 2009 Would this help for Firefox? expandcollapse popupFunc FF_Create($url = "www.mozilla.com", $firefox_exe = "C:\Program Files\Mozilla Firefox\firefox.exe") Local $pid = Run($firefox_exe) Sleep(2500) Send("^l") Sleep(1000) Send($url) Send("{ENTER}") return $pid EndFunc Func FF_GetText($windowtitle = "Mozilla Firefox", $windowtext = "") Local $count = 0 While (WinActive($windowtitle, $windowtext) = 0 AND $count < 10) WinActivate($windowtitle, $windowtext) $count = $count + 1 WEnd If ($count <> 10) Then Send("^a") Sleep(500) Send("^c") Sleep(1000) $text = ClipGet() return $text Else return 0 EndIf EndFunc Func FF_Close ($windowtitle = "Mozilla Firefox", $windowtext = "") If (WinActivate($windowtitle, $windowtext) = 1 ) Then Send("!{F4}") EndIf EndFunc www.jonahgregory.com Link to comment Share on other sites More sharing options...
FreeFry Posted April 30, 2009 Share Posted April 30, 2009 I dunno about firefox, but if all you want to do is modify all pages in all open ie windows, this should work: #include <IE.au3> _IEErrorHandlerRegister() While 1 _CheckBrowsers() Sleep(250) WEnd Func _CheckBrowsers() Local $avWindows = WinList("[CLASS:IEFrame]") Local $oIE For $i = 1 To $avWindows[0][0] $oIE = _IEAttach($avWindows[$i][1], "HWND", $i) If IsObj($oIE) Then _IEDocWriteHTML($oIE, "<center>David, you can not make me fool. go use your own pc. i don't have bandwidth for you.</center>") $oIE = 0 EndIf Next EndFunc Link to comment Share on other sites More sharing options...
SoftVoile Posted April 30, 2009 Author Share Posted April 30, 2009 I dunno about firefox, but if all you want to do is modify all pages in all open ie windows, this should work: #include <IE.au3> _IEErrorHandlerRegister() While 1 _CheckBrowsers() Sleep(250) WEnd Func _CheckBrowsers() Local $avWindows = WinList("[CLASS:IEFrame]") Local $oIE For $i = 1 To $avWindows[0][0] $oIE = _IEAttach($avWindows[$i][1], "HWND", $i) If IsObj($oIE) Then _IEDocWriteHTML($oIE, "<center>David, you can not make me fool. go use your own pc. i don't have bandwidth for you.</center>") $oIE = 0 EndIf Next EndFunc this 'll attach to all opened pages, how to attach to only spesific pages or websites? thanks for the code... Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. Link to comment Share on other sites More sharing options...
SoftVoile Posted May 1, 2009 Author Share Posted May 1, 2009 bump Unresolved topics:1- Please help me in Editing or replacing a page in FireFox and IE.Please have a look at them. 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