Rickname Posted October 10, 2014 Share Posted October 10, 2014 (edited) So lets say I have the link : "autoitscript.com/forum/" How can I find if its HTTP or HTTPS secured or maybe other protocol ? I would prefer via the _IE UDFs if possible... Thanks in advance ! Edited October 10, 2014 by Rickname Link to comment Share on other sites More sharing options...
MikahS Posted October 10, 2014 Share Posted October 10, 2014 You can use _IELinkGetCollection to get all the links on a page. This example on the helpfile shows how to get the link out of the object. From their you can parse it and check whether it is HTTP or HTTPS. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Rickname Posted October 10, 2014 Author Share Posted October 10, 2014 You can use _IELinkGetCollection to get all the links on a page. This example on the helpfile shows how to get the link out of the object. From their you can parse it and check whether it is HTTP or HTTPS. Yes, but this gives all the links which some are HTTP and others are HTTPS. How can I find the state for my specific link ? Link to comment Share on other sites More sharing options...
MikahS Posted October 10, 2014 Share Posted October 10, 2014 Find the specific link in that collection, then put the string into a variable. You can use StringReplace or StringInStr to do this, then take the whole path and parse out the HTTP or HTTPS. I would first search for HTTPS then HTTP as searching for HTTP and if it is 'HTTPS' it will find it, so searching for the HTTPS would be best. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
JohnOne Posted October 10, 2014 Share Posted October 10, 2014 Check if the fifth letter is an s. Is this a real question. MikahS 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Rickname Posted October 10, 2014 Author Share Posted October 10, 2014 Check if the fifth letter is an s. Is this a real question. Omg dude, Ive said I don't have the FULL link, only the stub of it ! If I would had the FULL link ofcourse I wouldn't ask this, pls read carefully Link to comment Share on other sites More sharing options...
MikahS Posted October 10, 2014 Share Posted October 10, 2014 _IENavigate using a hidden external window and get the address from that, close the window, parse the string for the HTTPS or HTTP. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Rickname Posted October 10, 2014 Author Share Posted October 10, 2014 Find the specific link in that collection, then put the string into a variable. You can use StringReplace or StringInStr to do this, then take the whole path and parse out the HTTP or HTTPS. I would first search for HTTPS then HTTP as searching for HTTP and if it is 'HTTPS' it will find it, so searching for the HTTPS would be best. This method doesn't work as I said, if you try this example, I mean with the "autoitscript.com" link, this link WON'T APPEAR in the listed links ! So even if I search for it, it will find nothing ! : ; Open browser with basic example, get link collection, ; loop through items and display the associated link URL references #include <IE.au3> #include <MsgBoxConstants.au3> Local $oIE = _IECreate( "autoitscript.com" ) Local $oLinks = _IELinkGetCollection($oIE) Local $iNumLinks = @extended Local $sTxt = $iNumLinks & " links found" & @CRLF & @CRLF For $oLink In $oLinks $sTxt &= $oLink.href & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Link Info", $sTxt) Link to comment Share on other sites More sharing options...
JohnOne Posted October 10, 2014 Share Posted October 10, 2014 Omg dude, Ive said I don't have the FULL link, only the stub of it ! If I would had the FULL link ofcourse I wouldn't ask this, pls read carefully What you say in your own head is no good to the forum. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Rickname Posted October 10, 2014 Author Share Posted October 10, 2014 _IENavigate using a hidden external window and get the address from that, close the window, parse the string for the HTTPS or HTTP. Ok so I open hidden IE window running the stub link, and I will read the address bar with the AutoIt methods... seems it would do the job.. But I can't also find if its http or https from the source code of the page ? Link to comment Share on other sites More sharing options...
MikahS Posted October 10, 2014 Share Posted October 10, 2014 Use the .protocol object method on the internet explorer object created in your hidden IE window. Just like you got the .href you want the protocol of the object. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Rickname Posted October 10, 2014 Author Share Posted October 10, 2014 What you say in your own head is no good to the forum. Ok my mistake if I wasn't explicit enough 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