Am trying to read strings from a html page to get settings the following javascript strings i like to be able to read.

<script type="text/javascript">
   PP['channel'] = "testchannel";
   PP['channel_id'] = 39388311;
   PP['channel_category'] = "gaming";
   PP['channel_meta_game'] = "wow"
   PP['channel_is_featured'] = false;
</script>

would be nice that i can pick the data i wish to read like so

Label1.Captaion := dat[0]; // channel name
Label1.Captaion := dat[1]; // channel id

so on

thanks hope some one can help

Something like this:

 var
   IdHTTP: TIdHTTP;
   Stream: TStringStream;
   Result: string;
 begin
   IdHTTP := TIdHTTP.Create(nil);
   Stream := TStringStream.Create;
   try
     try
       IdHTTP.Get(aURL, Stream);
       Result := Stream.DataString;
     except
       Result := '';
     end;
   finally
     Stream.Free;
     IdHTTP.Free;
   end;
 end;

Then you can try to put result in a string list and read it line by line.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.