473,791 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python/libxml2dom questions

hi paul...

in playing around with the test python app (see below) i've got a couple of
basic questions. i can't seem to find the answers via google, and when i've
looked in the libxml2dom stuff that i downloaded i didn't see answers
either...

for the list in the "for label in d.xpath" how can i find out the size of
the list???? a simple/basic question, but it's driving me up a wall!!!

also, how can i determine what methods are available for a libxml2dom
object?

thanks...

-bruce
Jul 2 '06 #1
3 2400
"bruce" <be*******@eart hlink.netwrote in message
news:ma******** *************** *************** *@python.org...
hi paul...

in playing around with the test python app (see below) i've got a couple
of
basic questions. i can't seem to find the answers via google, and when
i've
looked in the libxml2dom stuff that i downloaded i didn't see answers
either...

for the list in the "for label in d.xpath" how can i find out the size of
the list???? a simple/basic question, but it's driving me up a wall!!!
I'm at a loss. Python ships with sample code. libxml2dom ships with sample
code. Somewhere in there must be code that evaluates the length (hint) of a
list.

What search terms are you googling for? The 3rd link returned from Google,
searching for "python list size" is this one.

http://www.brpreiss.com/books/opus7/html/page82.html

Yes, this is a simple/basic question. It is so simple/basic, that it gets
discussed in just about every Python tutorial within the first 3 pages.
also, how can i determine what methods are available for a libxml2dom
object?
Didn't I post a message earlier describing dir and help? You need to do
some basic reading, man!
-- Paul
Give a man a fish and you feed him for a day;
give a man a fish every day and you feed him for the rest of his life.
Jul 2 '06 #2
"bruce" <be*******@eart hlink.netwrote:
also, how can i determine what methods are available for a libxml2dom
object?
Have you tried dir(object)? It works great on the command-line
reply-eval-print loop.

-- Barry

--
http://barrkel.blogspot.com/
Jul 2 '06 #3
bruce wrote:
in playing around with the test python app (see below) i've got a couple of
basic questions. i can't seem to find the answers via google, and when i've
looked in the libxml2dom stuff that i downloaded i didn't see answers
either...

for the list in the "for label in d.xpath" how can i find out the size of
the list???? a simple/basic question, but it's driving me up a wall!!!

also, how can i determine what methods are available for a libxml2dom
object?
Obvious question: Why don't you use lxml? It's pretty well documented.

http://codespeak.net/lxml

For the rest of the questions: please read the Python tutorial on python.org.
It's very helpful for beginners.

Stefan
Jul 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1070
by: ankit | last post by:
Hi I am using libxml2dom package for DOM support in libxml2. There are some test programs in the package when I try to run that samples it give me following error: Traceback (most recent call last): File "prettyprint.py", line 7, in ? d = libxml2dom.parse(sys.argv) File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line 472, in parse
1
1916
by: ankit | last post by:
Hi, I am working with libxml2dom package for having DOM support with libxml2. There are some test examples are given along with the package but when I try to run that, it gives me following error: Traceback (most recent call last): File "namespaces.py", line 23, in ? document = libxml2dom.parse("test_ns.xml") File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line
2
1601
by: ankit | last post by:
I am using libxml2dom but having problem when parsing. It gives me the following error: File "exlibxml2dom.py", line 4, in ? document = libxml2dom.parse("moc.xml") File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line 472, in parse return parseFile(stream_or_string, html) File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line 484, in parseFile
3
1443
by: bruce | last post by:
paul, thanks for the replies to my issues!!! much appreciation. i've got the python app: http://www.boddie.org.uk/python/downloads/libxml2dom-0.3.3.tar.gz and i've downloaded it, an untarred it... i have the dir structure, but i don't know what needs to be done now!!! i have a setup.py. does it get run?
0
382
by: bruce | last post by:
hi paul... in playing around with the test python app (see below) i've got a couple of basic questions. i can't seem to find the answers via google, and when i've looked in the libxml2dom stuff that i downloaded i didn't see answers either... for the list in the "for label in d.xpath" how can i find out the size of the list???? a simple/basic question, but it's driving me up a wall!!!
0
2386
by: bruce | last post by:
hi... it appears that i'm running into a possible problem with mechanize/browser/python rgarding the "select_form" method. i've tried the following and get the error listed: br.select_form(nr = 1) br.select_form(name="foo") br.select_form(name=foo) br.select_form(name="foo")
2
3399
by: sauce | last post by:
Hi, this a newbie question, forgive me! Ok so I have some code written using the libxml2dom package (because I want to parse html pages) and I would like to have this work on a web server. The web server (from Hostmonster) has libxml2 installed, and I put the libxml2dom package folder in my cgi-bin directory where I'm running the script. However, when I try to run the script, I get this error: Traceback (most recent call last): File...
3
2643
by: bruce | last post by:
Hi... got a short test app that i'm playing with. the goal is to get data off the page in question. basically, i should be able to get a list of "tr" nodes, and then to iterate/parse them. i'm missing something, as i think i can get a single node, but i can't figure out how to display the contents of the node.. nor how to get the list of the "tr" nodes....
1
2218
by: bruce | last post by:
Hi. Got a test web page, that basically has two "<html" tags in it. Examining the page via Firefox/Dom Inspector, I can create a test xpath query "/html/body/form" which gets the target form for the test. The issue comes when I examine the page's source html. It looks like: <html> <body> </body>
1
1943
by: bruce | last post by:
hi... i've got the following situation, with the following test url: "http://schedule.psu.edu/soc/fall/Alloz/a-c/acctg.html#". i can generate a list of the tables i want for the courses on the page. however, when i try to create the xpath query, and plug it into the xpath within python, i'm missing something. if i have a parent xpath query, that generates a list of results/nodes... how can i then use the individual parent node, and...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.