Jump to content
Sign in to follow this  

inetget question

Recommended Posts

i want to save a certain webpage with inetget, only, to view this page you need to login first, if i try to save the page it doesnt save the actual page but the login form. I know the password and username necessary to login. what can i do to save the page like i want it?

thanks in advance...

Share this post

Link to post
Share on other sites

Have you tried the _IE functions? You may be SOL if you don't use some type of COM or figure out where it's submitting the login information to.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post

Link to post
Share on other sites

This is a converted from VBScript that can download a webpage to a MHT file.

Global $iMsg, $Flds, $iConf, $prueba, $cdoSuppressAll

$iMsg = ObjCreate("CDO.Message") ; Create Message object
$iConf = ObjCreate("CDO.Configuration") ; Create Message Configuration Object

$Flds = $iConf.Fields
;Flds("http://schemas.microsoft.com/cdo/configuration/urlproxyserver") = "proxyname:80"
;Flds("http://schemas.microsoft.com/cdo/configuration/urlproxybypass")= ""
;Flds("http://schemas.microsoft.com/cdo/configuration/urlgetlatestversion")= True
;Flds.Update ; If you are under a proxy, you need that configuration parameters

$iMsg.CreateMHTMLBody("http://www.dbforums.com/archive/index.php/t-783832.html", 0) ;, "Username", "Password" 'If needed (user & pass)

Global $Stm
$Stm = ObjCreate("ADODB.Stream")
$Stm.Type = 2 ; TypeBinary
$Stm.Charset = "US-ASCII"
Global $iDsrc, $Filepath
$Filepath = "c:\archivename.mht" ; Path to save the file & filename
$iDsrc = $iMsg.DataSource ; response.Write("Ha cargado el contenido de la pagina en el stream")
$iDsrc.SaveToObject($Stm, "_Stream")
FileDelete($Filepath) ; overwrite seems invalid
$Stm.SaveToFile($Filepath, 1) ; 1 = overwrite if file exists

The overwrite seems to fail as to why I added FileDelete().



Added a word "from" to the summary for clarity of being an AutoIt3 script.

Edited by MHz

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...