Return to Snippet

Revision: 38851
at January 8, 2011 14:20 by a1ananth


Initial Code
import urllib2
import xml.dom.minidom

source = urllib2.urlopen('http://www.bbc.co.uk/')
#data = repr(source.read());

doc = xml.dom.minidom.parse(source)

all = doc.getElementsByTagName("h3")

for h3 in all :
	parent = h3.parentNode
	if (parent.getAttribute("id") == "promo_area"):
		child = h3.childNodes[1]
		child = child.childNodes[2]
		print ("\nPresent Headline : ")
		print (child.data+ "\n")

Initial URL

                                

Initial Description

                                

Initial Title
My first python script

Initial Tags
data, web

Initial Language
Python