Sign in to follow this  
Followers 0
sabu

InetGet() not working ?

7 posts in this topic

Hello friends,

I am trying to open a web page using the InetGet() function as follows:

InetGet("http://www.google.com")

The browser window does not open at all. Can someone please tell me what I should do to open a web page or download a file using ftp. Please do show a sample script that uses the InetGet() funtion. An early reply would be highly appreciated.

Regards

Sabu.

Share this post


Link to post
Share on other sites



Hello friends,

I am trying to open a web page using the InetGet() function as follows:

InetGet("http://www.google.com")

The browser window does not open at all. Can someone please tell me what I should do to open a web page or download a file using ftp. Please do show a sample script that uses the InetGet() funtion. An early reply would be highly appreciated.

Regards

Sabu.

How did you determine that it doesn't work ?

Have you looked at the helpfile how the function needs to be used?

:whistle:


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Hello friends,

I am trying to open a web page using the InetGet() function as follows:

InetGet("http://www.google.com")

The browser window does not open at all. Can someone please tell me what I should do to open a web page or download a file using ftp. Please do show a sample script that uses the InetGet() funtion. An early reply would be highly appreciated.

Regards

Sabu.

Inetget downloads the contents of an url into a file. A sample script for INetGet is available in the AutoIt help files, search for it. The example should speak for itself.

If you want to open a browser to a specific location, you might want to use the _IECreate() function instead. Help is again found in the help files, but it goes a little something like this:

#include <IE.au3>
$oIE = _IECreate ("www.autoitscript.com")

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Inetget downloads the contents of an url into a file. A sample script for INetGet is available in the AutoIt help files, search for it. The example should speak for itself.

If you want to open a browser to a specific location, you might want to use the _IECreate() function instead. Help is again found in the help files, but it goes a little something like this:

#include <IE.au3>
$oIE = _IECreate ("www.autoitscript.com")

Hi,

Thanks guys for your reponses. As suggested by you, I browsed through the AutoIt help and found the following piece of sample code:

InetGet("http://www.mozilla.org", "C:\foo.html")

InetGet("http://www.autoitscript.com", "C:\mydownload.htm", 1)

InetGet("ftp://ftp.mozilla.org/pub/mozilla.org/README", "README.txt", 1)

; Advanced example - downloading in the background

InetGet("http://www.nowhere.com/somelargefile.exe", "test.exe", 1, 1)

While @InetGetActive

TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)

Sleep(250)

Wend

MsgBox(0, "Bytes read", @InetGetBytesRead)

Ironically, this didnt work for me either. Also, my IE version is 6.x. However, the code snippet in SadBunny's message worked. But how can I use that to download files/folders to my computer using ftp? The InetGet() function however has this feature of downloading files to desired filenames/folders, IF IT WORKS as claimed in the help files.

Regards

Sabu

Share this post


Link to post
Share on other sites

In my case, this works like a charm:

InetGet("ftp://ftp.xs4all.nl/pub/test/3mb.bin",@DesktopCommonDir&"\3mb_file.bin")

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

In my case, this works like a charm:

InetGet("ftp://ftp.xs4all.nl/pub/test/3mb.bin",@DesktopCommonDir&"\3mb_file.bin")
Also, check this from INetGet help:

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.

"http://myuser:mypassword@www.somesite.com"

The InetGet function works with http:// https:// and ftp:// - to change the transfer type when using ftp see the FtpBinaryMode option.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Also, check this from INetGet help:

Thanks, SadBunny. It worked like a charm for me too.

Regards

Sabu

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  
Followers 0