Top Commentators

OnTheRoad

  • Two guys and a Beer - Episode 85
  • Jam Session 2
  • Two guys and a Beer - Episode 84

Grabbing title tag from web page

At least a couple of options, the first using BeautifulSoup:

import urllib
import BeautifulSoup

soup = BeautifulSoup.BeautifulSoup(urllib.urlopen("https://www.google.com"))
print soup.title.string

And the second one using lxml:

import lxml.html
t = lxml.html.parse(url)
print t.find(".//title").text

Related:

  1. Reddit developers, please fix this I previously mentioned how dumb it was for someone to...
  2. Double click/tap detection on android’s MapView If there is a cleaner way to do it, please...

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>