Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

Getting description/keywords from current open Internet Explorer.

I am writing a favorites/bookmark program. I need to get the description and/or keywords from the current open page of Internet Explorer (as supplied with Windows XP).

I am using Delphi 6. I need the delphi code for this (as a beginner). I am giving 500 points as it is important.

Any help would be appreciated. Thanks.
0
rincewind666
Asked:
rincewind666
  • 4
  • 4
1 Solution
 
rincewind666Author Commented:
By the way, I already know the URL, if that's any help...
0
 
HypoviaxCommented:
This should be possible as you could temporarily downlaod the HTML open it and view it. I will post an example soon
0
 
HypoviaxCommented:
To download here is a good example:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20977025.html

Once downloaded do a search by loading into a richedit control (richedit1.lines.loadfromfile(...))

Then find the required text: an example:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_10223606.html

Regards,

Hypoviax

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
rincewind666Author Commented:
I have loaded the following sample html page into richedit1.  What is the delphi 6 code to extract the description into descriptionlabel and the keywords into keywordlabel?  Many thanks for your help.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0023)http://www.lycos.co.uk/ -->
<HTML><HEAD><TITLE>Lycos - meet you there : Picture Search / Chat / Free SMS Messages</TITLE>
<META http-equiv=content-type content="text/html; charset=iso-8859-1">
<META
content="Lycos Search for pictures, chat, free sms messages and all your portal requirements"
name=description>
<META content="Lycos, picture search, chat, free sms messages"
name=keywords><LINK media=all
href="Lycos - meet you there  Pict.....etc.
0
 
HypoviaxCommented:
Using richedit fintext:

FoundAt := RichEdit1.FindText('"', 0, length(richedit1.length), [stMatchCase]);//find start of description
Endof:=RichEdit1.FindText('"', foundat, length(richedit1.length), [stMatchCase]); //find end


then you can use the copy function to return the text

resultdesc:=copy(richedit1.text,foundat,foundat-endof);

You do the same thing for the keywords:


FoundAtKey := RichEdit1.FindText('"', endof, length(richedit1.length), [stMatchCase]);//find start of keywords
Endofkey:=RichEdit1.FindText('"', foundatkey, length(richedit1.length), [stMatchCase]); //find end


then you can use the copy function to return the text

resultkeywords:=copy(richedit1.text,foundatkey,foundatkey-endofkey);

You may need to fiddle around with it because i did it off the top of my head

Regards,

Hypoviax
0
 
rincewind666Author Commented:
Sorry Hypoviax, it didn't work - I think because the character appears many times in the code.  Nothing works so far.  Never mind, I am trying another way:

I have copied the entire html page "head" section into a string:  

S := <HEAD><TITLE>Lycos - meet you there : Picture Search / Chat / Free SMS Messages</TITLE><META http-equiv=content-type content="text/html; harset=iso-8859-1"><META content="Lycos Search for pictures, chat, free sms messages and all your portal requirements" name=description><META content="Lycos, picture search, chat, free sms messages" name=keywords><LINK media=all href="Lycos - meet you there  Pict.....etc.

Now I need to get rid of surplus text (<HEAD>, <TITLE>, <META>, etc) - a list of words which will probably always appear in this string. I realize that some words will be missed but as long as I get the words that nearly always appear. To cut down the size of this string, I need to delete these words.  I will have these words in a listbox or stringlist.

I need the delphi 6 code to delete a list of words from a string.  I hope you can help. Many thanks if you can.
0
 
HypoviaxCommented:
I've been a bit busy, but i can help. if you have time i will be able to post perhaps a complete working version in a couple of days. However have a look here:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20861127.html

for deleting words from a string
0
 
Eddie ShipmanAll-around developerCommented:
0
 
rincewind666Author Commented:
Apologies for the delay, due to personal reasons. Anyway, thanks for the help, everyone.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now