is there a way for a scar to read html or php webpage data ?
If yes then please give me some exemples and functions
is there a way for a scar to read html or php webpage data ?
If yes then please give me some exemples and functions
Code := GetPage('URLHere');
Harry, he said for a scar.
Ohh yea , thats what I needed ; And thnx
Now I only need to know the way how to work with that string ...
Is there a way to delete for exemple those html tags from the string
Is there a function to delete or find some strings in that variable ?
Damn , I need to find some tuts for this :P
Maybe the there are some good pascal tuts you can suggest ?![]()
HTML := Between('<html>','</html>', HTML);
WriteLn(HTML);
Like that?
Send SMS messages using Simba
Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!
Like
Code := GetPage(..);
HTML := Between('<html>', '</html>', Code);
yea , another function just what I needed :P
Now I only need an exmplenation of function delete , guys ?![]()
Delete works best with Pos. Using the getting rid of html tags as an example,
It finds the first case of <html> in the page and removes everything until it (so from 1 to Position of the string) + 5 as Pos outputs the starting position (so the < in this case) and we add 5 to get it to take out all the tag. it then finds the closing tag, and deletes from the start of it (this time we don't add 1 as we want it to start from the <) and deletes all the chars from i to the length of the result, - i so that it goes to the end and then + 1 as it misses out the last char otherwise.SCAR Code:function GetHTML(URLf: string): string;
var
i: integer;
begin
Result := GetPage(URLf);
i := Pos('<html>', Result);
Delete(Result,1,i+5);
i := Pos('</html>', Result);
Delete(Result, i, Length(Result)-i+1);
end;
Hope that helps to explain delete.
Also, look up the PostHTTPPage bit in the scar manual if you want to be able to use Post or Get variables with the url (useful for when you want Scar to interact with a website).
By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.
Very good exmplenation , thnx
One last thing ; So there is not a way to read php data with scar or pascal ?
And what function should I use If I want to read the txt file the same way ?
There are currently 1 users browsing this thread. (0 members and 1 guests)