Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
script that will pull info from html tags and display on seperate page
Old 03-11-2006, 07:51 PM script that will pull info from html tags and display on seperate page
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
I Want to pull information off of html pages.

For instance, I have a client, and I am doing seo for this client. I have a
database that I enter web page urls that I am working on. I want to have a
web page that will retrieve certain information from their pages and display on
my page.

So what will need to happen for instance: I have 5 or 6 pages for a web site
that I am working on and the url for these pages are in my database.

I want my script to pull the Title tags, (or possibly the h1, h2 tags, etc.,) off of
these pages that are in my database and list them on a web page for me.

I can write the select statement to pull the info (the web url) from my database,
but how do I get asp to go pull the title tag off of these pages and display them
to me?

Any suggestions?

Thanks,
Chip
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
 
Register now for full access!
Old 03-12-2006, 06:23 AM Re: script that will pull info from html tags and display on seperate page
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
From my scraper functions
This will extract the text from between the start and end tags specified in the strTag variable.
Code:
function GetTagText(strIn,strTag)
dim StartPos
dim EndPos
strIn = replace(strIn,vbCrLf,"")
strIn = replace(strIn,"'",chr(34))
StartPos = instr(strIn,"<" & strTag & ">") + (len(strTag) + 2)
EndPos = instr(StartPos,strIn,"</" & strTag & ">")
GetTagText = trim(mid(strIn,StartPos,EndPos - StartPos))
end function
Call is
Code:
response.write GetTagText(strIn,"title")
One day I'll code up a RegExp version.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-13-2006, 03:41 PM Re: script that will pull info from html tags and display on seperate page
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Something like this might be retrofitted if you want to use Regular Expressions (although I haven't done it myself):

http://www.4guysfromrolla.com/webtech/042501-1.shtml

RegExp ROCKS!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-15-2006, 01:37 AM Re: script that will pull info from html tags and display on seperate page
ChipJohns's Avatar
I don't know! Do you?

Posts: 488
Name: Chip Johns
Location: Savannah Georgia
Trades: 0
Thanks Chris and Adam,

I'm working with these. A little over my head right now, so I've got some more to learn. Thanks.. -Chip
ChipJohns is offline
Reply With Quote
View Public Profile Visit ChipJohns's homepage!
 
Reply     « Reply to script that will pull info from html tags and display on seperate page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.04240 seconds with 12 queries