Search the web
Sign In
New User? Sign Up
delphi-webbrowser · Delphi: Using IE's WebBrowser
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
extract keywords from html document   Message List  
Reply | Forward Message #10225 of 10267 |
Re: extract keywords from html document

I actually implemented this some time ago, in order to extract a meta
tag from an htmldocument you need to go through the documentelement
property of ihtmldocument3, the following code will go through all the
meta elements in a webpage

var
i: Integer;
Doc: OleVariant;
begin
Doc := MyWebBrowser2.Document;
for i := 0 to Doc.DocumentElement.all.Length -1 do
begin
if Supports( Doc.DocumentElement.all.Item(I,0), IHTMLMetaElement) then
begin
// this is a meta tag, cast it to IHTMLMetaElement to get info
from it
end;
end;
end;

Alternatively you can also use ihtmldocument3 getElementsByTagName to
get only the meta tags

var
Doc: OleVariant;
MetaCollection: IHTMLElementCollection;
begin
Doc := MyWebBrowser2.Document;
MetaCollection := Doc.GetElementsbyTagName( 'meta' );
// Metacollection is a htmlelementcollection that contains all the
meta tags in the webpage
end;

Please note that MyWebBrowser2 is supposed to be a IWebBrowser2
implementation




Wed Sep 10, 2008 2:02 am

nybnybnybnyb
Offline Offline
Send Email Send Email

Forward
Message #10225 of 10267 |
Expand Messages Author Sort by Date

hi, i work actually on browser helper object (dll in process com server)and i seek a function to get keywords meta element from a web page when ...
ouladnaouis
Offline Send Email
Mar 23, 2008
2:34 pm

Here is a possible solution in html and Js Paul <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="someThingElse"...
Paul A Norman
paulanormannz
Offline Send Email
Apr 6, 2008
10:23 am

I actually implemented this some time ago, in order to extract a meta tag from an htmldocument you need to go through the documentelement property of...
nybnybnybnyb
Offline Send Email
Sep 10, 2008
2:03 am

hi...thanks for the reply, i actually got it but with different implementation.. i got it by extracting the URL... thanks though, your solution is simplier and...
MARICOR MARAVILLA
marics_corner
Offline Send Email
Sep 10, 2008
5:58 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help