ScriptBasic
February 09, 2012, 07:22:19 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The ScriptBasic User, Developer and extension module guides are available at the WIKI.
 
   Home   Wiki Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Retriving a web page  (Read 1113 times)
support
Administrator
*****
Posts: 369


« on: September 24, 2008, 05:50:34 PM »

Q. How would I go about getting the html from a web page on the net?

A. You have two options. You can use the built in socket support in ScriptBasic or use the cURL extension module.

ScriptBasic Native
Code:
ON ERROR GOTO SiteError
OPEN "allbasic.info:80" FOR SOCKET AS #1
PRINT #1,"GET http://localhost/ HTTP/1.0\n\n"

WHILE NOT EOF(1)
  LINE INPUT #1, page_line
  PRINT page_line
WEND
CLOSE #1
END

SiteError:
PRINT "The web server allbasic.info on port 80 is not available\n"

cURL Extension Module

Example on All Basic

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!