iCode Posted February 24, 2014 Posted February 24, 2014 I'm getting inconsistent results with InetRead/_INetGetSource and wondering why The problem seems to be specific to certain websites, in this instance rt.com Here's the sample code... #include <Inet.au3> $url = "http://rt.com/news/ukraine-right-sector-militants-210/" $str = InetRead($url, 3) ;$str = _INetGetSource($url, True) ConsoleWrite("@error=" & @error & @LF) ConsoleWrite(BinaryToString($str, 4) & @LF) ;ConsoleWrite($str & @LF) Without changing anything at all, sometimes InetRead() will return a string, and sometimes it doesn't @error is always 0 either way When it doesn't return the expected string, it returns "US?BS", which is actually some sort of encoded character(s) i believe I've tried using BinaryToString() with 1, 2, 3 and 4 and though i've never gotten a string with 2 and 3, i have with 1 and 4, but again, the results are not consistent - sometimes it will return the expected string several times in a row, and then it won't for several times in a row I think it would be better in my case to not depend on IE since i need reliable results, so if anyone has any suggestions for downloading a file via http/https, i'd appreciate it. I am aware of wget for windows, but if there is a self-contained executable without the dependencies, i would prefer that FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)
water Posted February 24, 2014 Posted February 24, 2014 (edited) Have you tried$str = InetRead($url, 1)because as you do not use HTTPS there is no need to ignore SSL erros. Edited February 24, 2014 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
iCode Posted February 24, 2014 Author Posted February 24, 2014 I just tried it and it makes no difference FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences) CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)
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