Archive for the ‘XPath’ Category

XPath (libxml2) in Python

February 3, 2011 5 comments

Step 1: Install libxml2 using synaptic package manager

Step 2: Create an xml file that you want to traverse.

For example I am using w3school’s xml document
We can also use the local file exist on file system.

Step 3: Create a python for example having name

Open the import the libxml2 and urllib. Parse the xml file.

import libxml2
import urllib

Read more…

Categories: Python, XML, XPath