Hello, SMALL Basic programmer, welcome.
You know that you can download webpage from the internet using SMALL basic?
This is the algorithm:
1. Ask user about the link of the web page.
2. Download the webpage.
3. Print out the result of the step 2 to the screen, or
4. Ask the user about the folder to save the file to (optionally).
5. Save it to a file on local directory (optionally).
This is the code:
'Ask
TextWindow.WriteLine("1. What page do you like to traverse? Use https:// or http:// ")
wp = TextWindow.Read()
'Get the webpage (wp)
'gwp = Network.GetWebPageContents("www.facebook.com/katakatalelucondanlucu")
'gwp = Network.GetWebPageContents("https://corona.jakarta.go.id/id")
gwp = Network.GetWebPageContents(wp)
TextWindow.Write(gwp)
TextWindow.WriteLine("2. (Optional) Tell me, what is the folder you want the web page saved to, for instance C:\Users\Totzfreelance\mywebpage.html:")
folder = TextWindow.Read()
File.WriteContents(folder,gwp)
You know that you can download webpage from the internet using SMALL basic?
This is the algorithm:
1. Ask user about the link of the web page.
2. Download the webpage.
3. Print out the result of the step 2 to the screen, or
4. Ask the user about the folder to save the file to (optionally).
5. Save it to a file on local directory (optionally).
This is the code:
'Ask
TextWindow.WriteLine("1. What page do you like to traverse? Use https:// or http:// ")
wp = TextWindow.Read()
'Get the webpage (wp)
'gwp = Network.GetWebPageContents("www.facebook.com/katakatalelucondanlucu")
'gwp = Network.GetWebPageContents("https://corona.jakarta.go.id/id")
gwp = Network.GetWebPageContents(wp)
TextWindow.Write(gwp)
TextWindow.WriteLine("2. (Optional) Tell me, what is the folder you want the web page saved to, for instance C:\Users\Totzfreelance\mywebpage.html:")
folder = TextWindow.Read()
File.WriteContents(folder,gwp)
Tidak ada komentar:
Posting Komentar