Jump to content

Inetget Does Not Work


Recommended Posts

:) i managed to get the 1st script you gave me to work.

there was no error so i thought it might have work until i edited the part

from

$temp1 = @TempDir & "\tmp.html"

to

$temp1 = @ScriptDir & "\tmp.htm"

but i'm not so familiar with the Beta version yet.

is there any other way i can get AutoIt to download a page using InetGet? :mellow:

Keep is as

$temp1 = @TempDir & "\tmp.html"
, then after downloading, use
FileCopy( @TempDir & "\tmp.html",  @ScriptDir & "\tmp.html" )

#)

Link to comment
Share on other sites

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Moderators

cant find that in release version 3.11

how come everyone is using the beta version already? managed to find that _InetGetSource from the beta help file.

The beta is more stable than the release... look at the last released version (I think it was in August) and the last beta, I think it was yesterday or the day before :).

More Functionality = More Users (IMHO)

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.

Link to comment
Share on other sites

For some reason, I can't use the InetGet function when my firewall is switched on.

Even though it comes up and I give it permission in the firewall it still wont work, as soon as I turn the firewall off, no problem.

Link to comment
Share on other sites

thanks Lapo,

i still cant get it to work. do you have any simpler code from release version that can download files from internet?

:">

The first (>> InetGet("") ) is NOT documented in the help file but works here

#include <Inet.au3>

InetGet("http://www.yahoo.com/", "test.htm", 1, 0)

$a=(_INetGetSource('www.autoitscript.com'))
Msgbox(0,"",$a)

_FWrite(@TempDir & "\tmp.html",$a)

Func _FWrite($temp1,$text)
$file = FileOpen($temp1, 2)
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
FileWrite($file, $text & @CRLF)
FileClose($file)
EndFunc
Link to comment
Share on other sites

Keep is as

$temp1 = @TempDir & "\tmp.html"
, then after downloading, use
FileCopy( @TempDir & "\tmp.html",  @ScriptDir & "\tmp.html" )

#)

why the extra step when you can actually can download it straight to the script folder?

then there is no need for a FileCopy command there.

:)

New to script...But getting the hang of it.

Link to comment
Share on other sites

For some reason, I can't use the InetGet function when my firewall is switched on.

Even though it comes up and I give it permission in the firewall it still wont work, as soon as I turn the firewall off, no problem.

looks like there is someone else here with the same problem for Ineget.

i think if we are behind a router modem the problem still occurs even after disabling the firewall.

for my case, i disabled the ZoneAlarm firewall but the InetGet still does not work.

:)

New to script...But getting the hang of it.

Link to comment
Share on other sites

looks like there is someone else here with the same problem for Ineget.

i think if we are behind a router modem the problem still occurs even after disabling the firewall.

for my case, i disabled the ZoneAlarm firewall but the InetGet still does not work.

:)

Have you try the VBS script ?

If this doesn't work it's maybe your OS problem

What version of Internet Explorer do you have ?

EDIT:

Just tested the script and it's OK here in IE 5.5sp2 (win98se) WSH 5.6

'''''''''''On Error Resume Next
x = TextFromHTML("http://www.yahoo.com/") 
'WScript.Echo x 
Function TextFromHTML(URL) 
  set ie = createobject("internetexplorer.application") 
  ie.navigate URL 
  do until ie.readystate = 4 : wscript.sleep 10: loop 
  TextFromHTML = ie.document.body.outerHtml
  ie.quit 
End Function 
filename = "Yahoo.html" 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set newf = fso.createtextfile(filename) 
newf.WriteLine x
Edited by Lapo
Link to comment
Share on other sites

Wierd, I just tried using InetGet for my script and it also does not work:

If InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\update.dat") = 0 Then MsgBox(0, "", "ERROR 0!")
If RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Version" ) <> IniRead(@TempDir & "\update.dat", "AutoIt", "version", "") Then
    If InetGet(IniRead(@TempDir & "\update.dat", "AutoIt", "setup", ""), @TempDir & "\update.exe") = 0 Then MsgBox(0, "", "ERROR 1!")
    RunWait(@TempDir & "\update.exe")
EndIf
If RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaVersion" ) <> IniRead(@TempDir & "\update.dat", "AutoItBeta", "version", "") Then
    If InetGet(IniRead(@TempDir &"\update.dat", "AutoItBeta", "setup", ""), @TempDir & "\update.exe") = 0 Then MsgBox(0, "", "ERROR 2!")
    RunWait(@TempDir & "\update.exe")
EndIf

MsgBox(0, "Wood's AutoIt Updater", "Update Complete!")

What's going on? (This scriptlet used to work...)

???

#)

Edited by nfwu
Link to comment
Share on other sites

Wierd, I just tried using InetGet for my script and it also does not work:

If InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", @TempDir & "\update.dat") = 0 Then MsgBox(0, "", "ERROR 0!")
If RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Version" ) <> IniRead(@TempDir & "\update.dat", "AutoIt", "version", "") Then
    If InetGet(IniRead(@TempDir & "\update.dat", "AutoIt", "setup", ""), @TempDir & "\update.exe") = 0 Then MsgBox(0, "", "ERROR 1!")
    RunWait(@TempDir & "\update.exe")
EndIf
If RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaVersion" ) <> IniRead(@TempDir & "\update.dat", "AutoItBeta", "version", "") Then
    If InetGet(IniRead(@TempDir &"\update.dat", "AutoItBeta", "setup", ""), @TempDir & "\update.exe") = 0 Then MsgBox(0, "", "ERROR 2!")
    RunWait(@TempDir & "\update.exe")
EndIf

MsgBox(0, "Wood's AutoIt Updater", "Update Complete!")

What's going on? (This scriptlet used to work...)

???

#)

The InetGet get part works for me - try this:
If InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", _
        @TempDir & "\update.dat") = 0 _
        Then MsgBox(0, "", "ERROR 0!")

MsgBox(0, "1st If line <>", _
        "Prod RegRead = " & _
        RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Version") & @CR & _
        "INI read Prod = " & _
        IniRead(@TempDir & "\update.dat", "AutoIt", "version", ""))

MsgBox(0, "2nd If line <>", _
        "Beta RegRead = " & _ 
        RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaVersion") & @CR & _
        "INI read Beta = " & _
        IniRead(@TempDir & "\update.dat", "AutoItBeta", "version", ""))

Edit:

AutoUpdateIt.au3 seems to be broken by this "RegKey vs. update.dat" issue.

See Bug Report:

http://www.autoitscript.com/forum/index.ph...showtopic=23773

Edit2:

AutoUpdateIt.au3 is not broken. It was just me thinking that some blue text meant that the tool was telling me that I needed to update when I didn't. (When viewed via the Windows Classic theme.) AutoUpdateIt.au3 has been updated by strik3r0475 for "people" like me. Thanks!

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

i believe the script will work again if you try it in another environment.

just like what happened to me, it worked in my office environment but not at home. :mellow:

i think there should be something that is preventing it from working but i just can't figure it out.

it does not seems to be the firewall... :)

New to script...But getting the hang of it.

Link to comment
Share on other sites

it does not seems to be the firewall... :)

Did you try to add that site to your trusted sites in IE?

Even if you disabled your firewall there could be still something blocking your access to that site (or part of it).

I once had to do that with MSN music.

Just trying to help you out. :mellow:

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

The InetGet get part works for me - try this:

If InetGet("http://www.autoitscript.com/autoit3/files/beta/update.dat", _
        @TempDir & "\update.dat") = 0 _
        Then MsgBox(0, "", "ERROR 0!")

MsgBox(0, "1st If line <>", _
        "Prod RegRead = " & _
        RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "Version") & @CR & _
        "INI read Prod = " & _
        IniRead(@TempDir & "\update.dat", "AutoIt", "version", ""))

MsgBox(0, "2nd If line <>", _
        "Beta RegRead = " & _ 
        RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaVersion") & @CR & _
        "INI read Beta = " & _
        IniRead(@TempDir & "\update.dat", "AutoItBeta", "version", ""))

Edit:

AutoUpdateIt.au3 seems to be broken by this "RegKey vs. update.dat" issue.

See Bug Report:

http://www.autoitscript.com/forum/index.ph...showtopic=23773

Edit2:

AutoUpdateIt.au3 is not broken. It was just me thinking that some blue text meant that the tool was telling me that I needed to update when I didn't. (When viewed via the Windows Classic theme.) AutoUpdateIt.au3 has been updated by strik3r0475 for "people" like me. Thanks!

Wierd... when i terminated "explorer.exe" then ran the application then it worked!

???

#)

Link to comment
Share on other sites

My issue is strange, If I use InetGet for Http files it is fine even with my firewall on.

If it is FTP it doesn't work with my firewall on but does with it off. (McAfee)

The application has access through the firewall, and other FTP clients work OK, just not InetGet.

Link to comment
Share on other sites

My issue is strange, If I use InetGet for Http files it is fine even with my firewall on.

If it is FTP it doesn't work with my firewall on but does with it off. (McAfee)

The application has access through the firewall, and other FTP clients work OK, just not InetGet.

Generally, HTTP usually uses port 80 (the same as your browser), while FTP usually uses port 21. Are your firewall settings blocking FTP?
Link to comment
Share on other sites

  • 2 weeks later...

wonder if this issue will be fixed in the beta version.

anyone knows someone who is able to address this problem?

seems like different people here have different problems with Inetget thinggy...

:think:

New to script...But getting the hang of it.

Link to comment
Share on other sites

A solution I've found - external program - CURL.

http://www.autoitscript.com/fileman/users/public/nfwu/curl_basic.zip

The manual is built into the exe.

Run the batch file included with the exe to produce the manual.

Rather powerful appliaction...

If it ever tells you that "libeay32.dll" is missing, PM me. libeay32.dll is actually an optional dll for the app...

#)

Link to comment
Share on other sites

thanks forger & nfwu,

there are quite a few external applications to use.

but i feel there autoit should be able to do as well. that's why we are all using it.

i'm sure one day someone will come up with a solution... :think:

New to script...But getting the hang of it.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...