Jump to content

Help inetget doesn't work!


TheWebz
 Share

Recommended Posts

I made this code but the file doesn't show up in the script folder!

here is the code:

#include 
; Open needed handles
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
Global $hRequest = InetGet( "mp3skull.com/mp3/" & $zata & ".html", @ScriptDir )
InetClose( $hRequest )



; Display retrieved header
$r = FileRead( $zata & ".html" )
MsgBox( 64, "texto", "" & $r )
Beep( 700 )
Link to comment
Share on other sites

What's the return value and the value of @error after you called INetGet?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

You are mixing foreground and background download in your script.

InetGet is called to run in the foreground. InetClose is only needed when InetGet is run in the background.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

I add the file name and took out inetclose but it still doesn't work!

look:

#include
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
Global $hRequest = InetGet( "mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )




; Display retrieved header
$r = FileRead( $zata & ".html" )
MsgBox( 64, "texto", "" & $r )
Beep( 700 )
Edited by FranciscoLeal
Link to comment
Share on other sites

Change this line:

;from this
Global $hRequest = InetGet( "mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
;to this

Global $hRequest = InetGet("http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html")

From the help file:

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Ok i've improved a bit my code, but i can't find a way to display only the search results in the gui.

Code:

#include 
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
for $i = 0 to 100
Next
ProgressOn( "Searching..", "Working..", "Searching for " & $zolo & " ..." )
ProgressSet( 30 )
Global $hRequest = InetGet( "http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
ProgressSet( 100, "Done!" )
sleep(3000)
ProgressOff()


; Display retrieved header
Run( "ISTO.html" )
Beep( 700 )

Can anyone help me?

Link to comment
Share on other sites

I made this code. I build it in order to create a program wich will search for a music in a site and return the results.

#include 
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
for $i = 0 to 100
Next
ProgressOn( "Searching..", "Working..", "Searching for " & $zolo & " ..." )
ProgressSet( 30 )
Global $hRequest = InetGet( "http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
ProgressSet( 100, "Done!" )
sleep(3000)
ProgressOff()


; Display retrieved header
Run( @ScriptDir & "\ISTO.html" )
Beep( 700 )

I would like to know if it is possible and if someone can help me.

Link to comment
Share on other sites

  • Moderators

The Webz, please do not bump your posts without waiting at least 24 hours. This is not a 24-hour support forum; those of us who lend assistance do so because we enjoy the language and want to help. Remember, just because it is critical to you does not mean it is critical to everyone else :)

Edit: Also, you already have a thread going for this script Unless your request is wildly different, please stick to one thread at a time.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Ok i will explain better.

Here is the code that i've made:

#include 
; Open needed handles
$form = GUICreate( "test", 500, 500 )
GUISetState( @SW_SHOW )
Global $zolo = InputBox( "Musica", "-------" )
; Specify the reguest:
Global $zata = StringReplace( $zolo, " ", "_" )
for $i = 0 to 100
Next
ProgressOn( "Searching..", "Working..", "Searching for " & $zolo & " ..." )
ProgressSet( 30 )
Global $hRequest = InetGet( "http://www.mp3skull.com/mp3/" & $zata & ".html", @ScriptDir & "\ISTO.html" )
ProgressSet( 100, "Done!" )
sleep(3000)
ProgressOff()

I build it in order to create a program wich will search for a music in a site and return the results.

Can someone help me?

Link to comment
Share on other sites

  • Moderators

TheWebz, you need to explain precisely what is not working for you, rather than asking us to guess :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Developers

I have merged the threads and would appreciate when you:

  • are patient
  • better describe what you need help with or what is not working
  • stick to one thread.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...