retreiving data from html page

J

Jeff

I asked this question sometime ago. some help was given, but A.) i didn't
understand the help and B.) I can't find the post.

i am looking for a way to take a table of stats on an HTML page, and turn
the data into variables, and upload to a DB using ASP.

say if a page contained stats from a golf tournament, i would be able to
pull the data and insert it into a db table on MY server.

can someone help me with this??
 
E

Evertjan.

Jeff wrote on 08 okt 2006 in microsoft.public.inetserver.asp.general:
I asked this question sometime ago. some help was given, but A.) i
didn't understand the help and B.) I can't find the post.

i am looking for a way to take a table of stats on an HTML page, and
turn the data into variables, and upload to a DB using ASP.

say if a page contained stats from a golf tournament, i would be able
to pull the data and insert it into a db table on MY server.

can someone help me with this??

If the data are on your html page, you have put them there somehow, and you
should be able to get them from your source.

If the data ia from another man's page, you will have to do some
datamining:

<http://classicasp.aspfaq.com/general/how-do-i-read-the-contents-of-a-
remote-web-page.html>

and parse the resulting string for your data.
 
J

Jeff

yes, the page is NOT on my server.
this is where i get confused.
here is a page of some stats from MY server just to use as example.

http://www.gig-gamers.com/GIG/IHT_standings.asp

so let's say this was not on my server, but i wanted to get the data.

for the first name, MrNuddles, how would i pull those stats out for him.
meaning each round score and the totals. even the simple stuff like what the
field names or variables would be.

is there a dummy version of this??..lol
 
E

Evertjan.

Jeff wrote on 08 okt 2006 in microsoft.public.inetserver.asp.general:

[Please do not toppost on usenet]
yes, the page is NOT on my server.
this is where i get confused.

Don't be confused, but

1 read the above(!) link.
2 look thouroughly at the view source of the page in question,
3 go parse that page's html string ftom 1) with functions like
split() match()replase() and Regex.
 
J

Jeff

Evertjan. said:
Jeff wrote on 08 okt 2006 in microsoft.public.inetserver.asp.general:

[Please do not toppost on usenet]
yes, the page is NOT on my server.
this is where i get confused.

Don't be confused, but

1 read the above(!) link.
2 look thouroughly at the view source of the page in question,
3 go parse that page's html string ftom 1) with functions like
split() match()replase() and Regex.

guess it is time to learn more asp and stuff.

i read the page, and all the examples, and this still seems greek to me.
if i could see maybe one example of how a variable is derived from the html
text, it may make more sense.
 
E

Evertjan.

Jeff wrote on 08 okt 2006 in microsoft.public.inetserver.asp.general:
guess it is time to learn more asp and stuff.

i read the page, and all the examples, and this still seems greek to
me. if i could see maybe one example of how a variable is derived from
the html text, it may make more sense.

========== test.asp =========

<% ' vbscript
html = "<html><body><table><tr>"&_
"<td>data 12</td><td>13 data</td><tr>"&_
"<td>testing</td><td>Foo</td><tr>"&_
"</table></body></html>"
response.write parseMe(html)
%>

<script language='javascript' runat='server'>
function parseMe(t){
var result='';
data = t.match(/<td>[^<]+<\/td>/gi);
for (var i=0;i<data.length;i++)
result += i+': '+data.replace(/<\/?td>/gi,'')+'<br>';
return result;
}
</script>

=============================
 
J

Jeff

ok. i can see that. so how would you assign different variables??
split them??

Evertjan. said:
Jeff wrote on 08 okt 2006 in microsoft.public.inetserver.asp.general:
guess it is time to learn more asp and stuff.

i read the page, and all the examples, and this still seems greek to
me. if i could see maybe one example of how a variable is derived from
the html text, it may make more sense.

========== test.asp =========

<% ' vbscript
html = "<html><body><table><tr>"&_
"<td>data 12</td><td>13 data</td><tr>"&_
"<td>testing</td><td>Foo</td><tr>"&_
"</table></body></html>"
response.write parseMe(html)
%>

<script language='javascript' runat='server'>
function parseMe(t){
var result='';
data = t.match(/<td>[^<]+<\/td>/gi);
for (var i=0;i<data.length;i++)
result += i+': '+data.replace(/<\/?td>/gi,'')+'<br>';
return result;
}
</script>

=============================
 
E

Evertjan.

Jeff wrote on 08 okt 2006 in microsoft.public.inetserver.asp.general:
ok. i can see that. so how would you assign different variables??
split them??

[Please do not toppost on usenet]

In my example, the <td> contents are numbered.
 
M

Mike Brind

Jeff said:
I asked this question sometime ago. some help was given, but A.) i didn't
understand the help and B.) I can't find the post.

i am looking for a way to take a table of stats on an HTML page, and turn
the data into variables, and upload to a DB using ASP.

say if a page contained stats from a golf tournament, i would be able to
pull the data and insert it into a db table on MY server.

can someone help me with this??

Here's your original post with the answers. Note, the thread wasn't started
by you.

http://groups.google.com/group/micr...4a47a1b2d?lnk=gst&q=&rnum=11#f5b444a4a47a1b2d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top