hi...
i have the following test python script.... i'm trying to figure out a
couple of things...
1st.. how can i write the output of the "label" to an array, and then how i
can select a given element of the array.. i know real basic..
2nd.. where can i go to find methods of libxml2dom. i've been looking using
google, but can't seem to find a site pointing out the underlying methods,
which is kind of strange...
-bruce
-------------------------------------
test.py
#! /usr/bin/env python
#test python script
import libxml2dom
import urllib
print "hello"
turl =
"http://courses.tamu.ed u/ViewSections.as px?campus=CS&x= hvm4MX4PXIY9J8C 2Dcxz5
0ncXTJdT7v2&typ e=M"
f = urllib.urlopen( turl)
s = f.read()
f.close()
# s contains HTML not XML text
d = libxml2dom.pars eString(s, html=1)
# get the community-related links
for label in
d.xpath("/html/body/table/tr/td[2]/table/tr[6]/td/table/child::tr/td[@class=
'sectionheading ']/text()"):
print label.nodeValue
i have the following test python script.... i'm trying to figure out a
couple of things...
1st.. how can i write the output of the "label" to an array, and then how i
can select a given element of the array.. i know real basic..
2nd.. where can i go to find methods of libxml2dom. i've been looking using
google, but can't seem to find a site pointing out the underlying methods,
which is kind of strange...
-bruce
-------------------------------------
test.py
#! /usr/bin/env python
#test python script
import libxml2dom
import urllib
print "hello"
turl =
"http://courses.tamu.ed u/ViewSections.as px?campus=CS&x= hvm4MX4PXIY9J8C 2Dcxz5
0ncXTJdT7v2&typ e=M"
f = urllib.urlopen( turl)
s = f.read()
f.close()
# s contains HTML not XML text
d = libxml2dom.pars eString(s, html=1)
# get the community-related links
for label in
d.xpath("/html/body/table/tr/td[2]/table/tr[6]/td/table/child::tr/td[@class=
'sectionheading ']/text()"):
print label.nodeValue
Comment