From: Ömür UÇUM on
Hi,

how can I parse a web page whit asp functions.I need only some
informations in a web page in my project.This informations are
updetede every day.And I wont to insert this informations in my
page.Can some body help me.

Thanks..
From: Bob Barrows on
�m�r U�UM wrote:
> Hi,
>
> how can I parse a web page whit asp functions.I need only some
> informations in a web page in my project.This informations are
> updetede every day.And I wont to insert this informations in my
> page.Can some body help me.
>
> Thanks..

Start with the vbscript documentation
(http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-
4be1-8a76-1c4099d7bbb9&DisplayLang=en) about string functions, as well
as
the filesystemobject class in case you are asking about parsing the
files themselves.
--
HTH,
Bob Barrows



From: Evertjan. on
Bob Barrows wrote on 29 mrt 2010 in
microsoft.public.inetserver.asp.general:

> �m�r U�UM wrote:
>> Hi,
>>
>> how can I parse a web page whit asp functions.I need only some
>> informations in a web page in my project.This informations are
>> updetede every day.And I wont to insert this informations in my
>> page.Can some body help me.
>>
>> Thanks..
>
> Start with the vbscript documentation
> (http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-
207d-
> 4be1-8a76-1c4099d7bbb9&DisplayLang=en) about string functions, as well
> as
> the filesystemobject class in case you are asking about parsing the
> files themselves.

I would advice to use ASP javascript and regular expression functions
under Javascript, far easier to implement than using VBscript.

examples:

txtArr = txt.match(/..../g);

or

var txt2 =
txt.replace(/^[\s\S]+?(<div id='Blah'[\s\S]+?(<\/div))[\s\S]+$/,'$1');

or even

var bool = /23\.8\d\D/.test(txt);

First download the page to your own server's string variable with

<script language=javascript runat=server>
var xmlhttp = new ActiveXObject("MSXML2.ServerXMLHTTP");
var url = 'http://myURL.nl/myPage.html';

xmlhttp.open('GET', url, 0);
xmlhttp.send('');
if (xmlhttp.status!=200) {
response.write('Not status 200');
xmlhttp = null;
response.end;
} else {
var txt = xmlhttp.responseText;
};
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 | 
Pages: 1
Prev: Using a name in a URL???
Next: BEWARE OF AT&T!