How to read html url as string
Posted: Mon Sep 11, 2017 12:05 pm
how to read HTML from url for processing as strings for parsing and extract info?
- a basic to master the web -
https://forums.spiderbasic.com/
do you mean the URL-Parameters? Then you can use ProgramParameter()Rjevsky wrote:how to read HTML from url for processing as strings for parsing and extract info?
Code: Select all
<!DOCTYPE html>
<html>
<head>
<title>...</title>
</head>
<body>
....
</body>
</html>
this is not that easy because of the Same-Origin-PolicyRjevsky wrote:I want to get HTML pages.
Code: Select all
Procedure ScrapPageCallback(Result.s)
Debug Result
EndProcedure
Procedure ScrapPage(Url.s, Callback)
! $.getJSON('http://www.whateverorigin.org/get?url=' + encodeURIComponent(v_url) + '&callback=?', function(data){
! v_callback(data.contents);
! });
EndProcedure
ScrapPage("http://www.spiderbasic.com", @ScrapPageCallback())
Thanks for the help. Can I make it even easier: to display the page from my web server? (I need it for the android application)Peter wrote:The better way is to run a little php-snippet on your own server
WebGadget() ?Rjevsky wrote:Can I make it even easier: to display the page from my web server?