views:

47

answers:

3

I need to do screen scraping and for that i need to convert xml to dom in python please can anybody tell that how can i do this....

+1  A: 

Check out the minidom package which also has examples.

BTW if your screen scraping is HTML don't use XML parsing. There's other stuff for that. (Question about screen scraping, Question about python HTML screen scraping).

extraneon
And there's other, more comfortable stuff than minidom, mainly the ElementTree API :)
lunaryorn
I happen to like minidom. It works, and it's always included in Python. Easier to get it deployed that way, especially if the servers are maintained by others.
extraneon
A: 

The lxml library works well for scraping HTML. Here are some links to get you started:

ars
A: 

I agree to lunaryorn. To extract from xml, if you go for converting it to dom its not that comfortable & the most difficult will be understanding how to do it. I don't major in python and stuff but yes if u want a simpler and easier way for data extraction its better to go for Automation Anywhere. It's a tool. It doesn't require any coding or parsing methods, its just point & click. So I would prefer you have a hand on it. You can get data having xml formatting and save to the desired location using: XML sessions, Node functionalities like Insert, Update and Get Nodes, Validate XML file and Perform XPath Expression. Check out other details and free trial of this web data extraction tool. I hope you will like it.

Bob