Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- getting title, desciption for webpages
- à¤°à¤µà¥à¤à¤¦à¤° à¤ à¤¾à¤à¥à¤° (ravinder thakur)
June 7, 2008, 1:32 pm
rate this thread
i am trying to find some generic way of getting the title and
description of webpages such as the one shown by google in the search
results. is there any _easy_ method that we can use for same ? i have
tried google apis but apparently it doesn't contain the titles/
description of all the web pages. i will be doing this in python.
Re: getting title, desciption for webpages
Try googling with words like
python html parse
The first hit I got is
which might suit your needs.
It's probably easier to write two good HTML parsers than to decide which
of them is better. But for extracting the <title> element and the <meta>
element with name="description", any good or half-good parser should do.
Just make sure you recognize the tag and attribute names and the value
"description" in a case-sensitive manner and do not change the case of
anything in the title and description you extract (unless you really
Jukka K. Korpela ("Yucca")