On Sep 10, 12:20 pm, jakecjacobson wrote:
> I am trying to build a Python script that reads a Sitemap file and
> push the URLs to a Google Search Appliance. I am able to fetch the
> XML document and parse it with regular expressions but I want to move
> to using native XML tools to do this. The
jakecjacobson, 10.09.2010 18:20:
response = urllib2.urlopen(request)
pageguts = response.read()
xmldoc = minidom.parse(pageguts)
Check the minidom docs, there's a parseString() function that does what it
says.
Also, don't forget to take a look at xml.etree.ElementTree
try using parse from string ... and try
minidom.parse(StringIO.StingIO(string)).documentElement
On Fri, Sep 10, 2010 at 9:50 PM, jakecjacobson wrote:
> I am trying to build a Python script that reads a Sitemap file and
> push the URLs to a Google Search Appliance. I am able to fetch the
> XML d
I am trying to build a Python script that reads a Sitemap file and
push the URLs to a Google Search Appliance. I am able to fetch the
XML document and parse it with regular expressions but I want to move
to using native XML tools to do this. The problem I am getting is if
I use urllib.urlopen(url