charon Posted February 25, 2015 Posted February 25, 2015 Why is it that I can open the link I have to the expected webpage using _IECreate but when I try and download the source using the same link It downloads the login page instead even though I am already logged into the site with IE? Does InetGetSource work with links that have variables in the link? $BACCMAC = GUICtrlRead($MAC_input) ;MAC address input $BACC_URL = "https://npgsui-external.test.net/bacc/jsp/bacc_mta_search.do?action=OPEN_DEV_DETAILS&mac_addr=1%2C6%2C6x%3Aee%3A96%3Ad8%3Aa0%3A60&page_number=0&searchType=MTA_MAC_SEARCH&searchQuey=" & $BACCMAC ;msgbox(0, "", $BACC_URL) $BACC_Source = _INetGetSource($BACC_URL) ;why is it downloading the login page when I am already logged in using IE and page opens without prompting for login ;write source file to disk $file = FileOpen("BACC_DATA.html", 2) ; The value of 2 overwrites the file if it already exists FileWrite($file, $BACC_Source) FileClose($file) Local $BACCArray = 0 ;holds web page with switch If Not _FileReadToArray(@ScriptDir & "\BACC_DATA.html", $BACCArray) Then MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file. EndIf _ArrayDisplay($BACCArray) Local $IP_Results = _ArraySearch($BACCArray, ">IP", 0, 0, 0, 1) ;return array index where IP was found MsgBox($MB_SYSTEMMODAL, "test", "IP Address: " & $BACCArray[$IP_Results + 3]) Local $oIE_Signin = _IECreate($BACC_URL, 0, 1, 0) ;attach=1, visible=1, wait for page to load=1 ;works: displays correct webpage If @error Then MsgBox($MB_SYSTEMMODAL, "", "Err-oarrrr") EndIf
Trong Posted February 25, 2015 Posted February 25, 2015 $file = FileOpen("BACC_DATA.html", 2+8+128) Regards,
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