AlienStar Posted October 9, 2017 Share Posted October 9, 2017 hello everybody I wanna use _IECreate() function with private browsing mode how to do this please ?? Link to comment Share on other sites More sharing options...
Danp2 Posted October 9, 2017 Share Posted October 9, 2017 Maybe this thread will help you. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
AlienStar Posted October 9, 2017 Author Share Posted October 9, 2017 (edited) 4 minutes ago, Danp2 said: Maybe this thread will help you. in my app I need to open a page in _IECreate() then close then re-open is there anyway to edit IE.au3 to add -private parameter ?? Edited October 9, 2017 by AlienStar Link to comment Share on other sites More sharing options...
Danp2 Posted October 9, 2017 Share Posted October 9, 2017 31 minutes ago, AlienStar said: in my app I need to open a page in _IECreate() then close then re-open is there anyway to edit IE.au3 to add -private parameter ?? Not AFAIK. You could create your own function (_IECreatePrivate or whatever) to do what you need. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
jguinch Posted October 9, 2017 Share Posted October 9, 2017 Try this one : #Include <IE.au3> $oIE = _IECreatePrivate("http://www.autoitscript.com") Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1) Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private " & $sUrl, @ProgramFilesDir & "\Internet Explorer") Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 3) If Not $hPrivateIE Then Return SetError(1, 0, 0) Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") If @error Then Return SetError(2, 0, 0) If $iWait Then _IELoadWait($oPrivateIE) Return $oPrivateIE EndFunc Danp2 and AlienStar 2 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
AlienStar Posted October 9, 2017 Author Share Posted October 9, 2017 (edited) 4 hours ago, jguinch said: Try this one : #Include <IE.au3> $oIE = _IECreatePrivate("http://www.autoitscript.com") Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1) Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private " & $sUrl, @ProgramFilesDir & "\Internet Explorer") Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 3) If Not $hPrivateIE Then Return SetError(1, 0, 0) Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") If @error Then Return SetError(2, 0, 0) If $iWait Then _IELoadWait($oPrivateIE) Return $oPrivateIE EndFunc thanks so much it works fine but I can't use other IE functions according to this function _IECreatePrivate I need to use : _IEDocReadHTML($oIE) _IELoadWait($oIE) they don't work Edited October 9, 2017 by AlienStar Link to comment Share on other sites More sharing options...
jguinch Posted October 9, 2017 Share Posted October 9, 2017 Please, show your code... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
AlienStar Posted October 9, 2017 Author Share Posted October 9, 2017 (edited) 4 hours ago, jguinch said: Please, show your code... Local $oIE = _IECreate("https://twitter.com/login?username_or_email=xxxxx") while _IELoadWait($oIE)=false Sleep(100) wend Send("{TAB}") $password = xxxxxxxxx Send($password) Send("{ENTER}") Local $sHTML = _IEDocReadHTML($oIE) MsgBox(0,"content ",$sHTML) Edited October 9, 2017 by AlienStar Link to comment Share on other sites More sharing options...
XinYoung Posted June 15, 2019 Share Posted June 15, 2019 On 10/9/2017 at 10:23 AM, jguinch said: Try this one : #Include <IE.au3> $oIE = _IECreatePrivate("http://www.autoitscript.com") Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1) Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private " & $sUrl, @ProgramFilesDir & "\Internet Explorer") Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 3) If Not $hPrivateIE Then Return SetError(1, 0, 0) Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") If @error Then Return SetError(2, 0, 0) If $iWait Then _IELoadWait($oPrivateIE) Return $oPrivateIE EndFunc Hi, sorry to bring up an old thread, but this is the best "IECreatePrivate" function I've found. It works quite well, but for some reason I cannot control $oIE afterwards. Are you still around to help? Link to comment Share on other sites More sharing options...
Nine Posted June 15, 2019 Share Posted June 15, 2019 If you look at scite console, you can see that the _IEAttach gives a warning Hence, SetError is returned, not the object. But if you add a small delay before it will work. #Include <IE.au3> $oIE = _IECreatePrivate("http://www.autoitscript.com") If @error Then MsgBox ($MB_SYSTEMMODAL,"","Error") Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1) Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private " & $sUrl, @ProgramFilesDir & "\Internet Explorer") Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 10) If Not $hPrivateIE Then Return SetError(1, 0, 0) Sleep (1000) Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") If @error Then Return SetError(2, 0, 0) If $iWait Then _IELoadWait($oPrivateIE) Return $oPrivateIE EndFunc You should know by now that checking for @error is always a good practice. XinYoung 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jguinch Posted June 16, 2019 Share Posted June 16, 2019 Good point for the Sleep(), I managed to reproduce the issue. You can also use this one : #Include <IE.au3> $oIE = _IECreatePrivate("http://www.autoitscript.com") Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1) Local $oPrivateIE Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private about:blank", @ProgramFilesDir & "\Internet Explorer") Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 3) If Not $hPrivateIE Then Return SetError(1, 0, 0) Sleep(200) $oPrivateIE = _IEAttach($hPrivateIE, "hwnd") If @error Then Return SetError(@error, 0, 0) _IENavigate($oPrivateIE, $sUrl, $iWait) Return $oPrivateIE EndFunc Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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