Jump to content

_INetGetSource @extended returning different bytes

Recommended Posts



I was playing around with _INetGetSource(), and just seeing how it returned the bytes. It doesn't seem to return what I would expect, though. For example, I loaded up http://asdf.com/aboutasdf.html, and viewed the page source. Copy/ pasted that into a Notepad++ document, and I get a length of 2,481 characters > 2,481 bytes. When I do:

#include <Inet.au3>

Global $sSource, $sSite = "http://asdf.com/aboutasdf.html"
Global $iBytes

$sSource = _INetGetSource($sSite) ;Get the page source for the account
If Not @error Then ;As long as nothing goes wrong
    $iBytes += @extended ;Get number of bytes returned
    MsgBox(0, '', $iBytes & @CRLF & $sSource) ;Number of bytes, and the source

I get a return of 2,391 bytes (missing 90 bytes) from the @extended when I run _INetGetSource(). If I put the page source into my clipboard and paste that into the Notepad++ document, I still get 2,479 (it removed the top blank line that I get when selecting all from the page source in my browser). So the source that I copy from my browser, and that AutoIt puts in my clipboard is ~2,480 bytes. So, why is the @extended returning 2,391? Maybe I'm just missing something.

On just http://asdf.com/ it returns 1,892, which I get when copy/pasting as well, from the script and from the browser.



RAWR! I'm hungry :( Feed the panda squirrle

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By AndreyS
      Tell me, please, who knows why the function does not work with the specified site? _INetGetSource ("https://residence.biz.ua/")
      It is necessary to work with the protocol https. What is the problem?
    • By souldjer777
      Good Morning AutoIT Geniuses! 
      Now, it could be that I've been away for a while - but I can get source from just about any website except adobe using InetGetSource.
      I have no idea why...   error: 13
      #include <Inet.au3> HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko") Local $sOpenAdobe_URLSecurityUpdates = 'https://helpx.adobe.com/security.html' Local $OpenSSL01 = _INetGetSource($sOpenAdobe_URLSecurityUpdates) WinHttp.au3 is returning results - I just don't get it...
      #include "WinHttp.au3" Opt("MustDeclareVars", 1) ; Initialize and get session handle Global $hOpen = _WinHttpOpen() ; Get connection handle Global $hConnect = _WinHttpConnect($hOpen, "helpx.adobe.com") ; Make a request Global $hRequest = _WinHttpSimpleSendRequest($hConnect, Default, "/security.html?promoid=HRYCM") If $hRequest Then ; Simple-read... ConsoleWrite(_WinHttpSimpleReadData($hRequest) & @CRLF) MsgBox(64, "Okey do!", "Returned source is print to concole. Check it.") Else MsgBox(48, "Error", "Error ocurred for _WinHttpSimpleSendRequest, Error number is " & @error) EndIf ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen)  
    • By souldjer777
      Good Morning All AutoIT Gurus,
      Does anyone know how I can get the right responses for Inet.au3 or IE.au3 for sites that check your browser, os, etc using Javascript? For some reason the source is empty using the built-in tools in AutoIT... doesn't contain the version information when reading using inetgetsource or iedocreadhtml ... The point is to find out the latest version automatically using AutoIT tools. 
      Example: https://get.adobe.com/flashplayer/
      #include <Inet.au3> $OpenHTML01 = _INetGetSource("https://get.adobe.com/flashplayer/") MsgBox (0, "", $OpenHTML01) A typical page response would include...
      System requirements"
      ... within the <div id="autoSelectedVersion"> tag.

      UPDATE: I believe it's this file that determines what OS, language, x32, x64, browser, etc that you are using and then reports it back...
  • Create New...