Tagged Questions
1
vote
1answer
29 views
Python compare contents of files and replace content of one of them
I am sorry if my title sounds confusing.
I am writing a Python script that compares 2 XML files. In both files we have data for which the id's are equal to those in the other file.
E.g.
Source file: ...
2
votes
2answers
28 views
Python elementree having hard time extracting data
Here is the XML:
<top>
<target>
<name>TARGET_NAME_1</name>
<error_count>5</error_count>
<error_examples>a string goes ...
1
vote
1answer
30 views
XML parsing - the ^H character/symbol?
I'm having a really bad time trying to clean up some XML so I can parse it in Python with etree. Basically before my Python script reads it, I'm trying to escape all the special characters in each ...
2
votes
4answers
46 views
How do I get raw text with beautifulsoup?
I have a xml like this:
<link>
www.link1.com
</link>
<link>
www.link2.com
</link>
I have tried this code:
from BeautifulSoup import BeautifulStoneSoup
soup = ...
1
vote
2answers
38 views
Null Text Node issue with xml.dom.minidom in Python
Environment: Python 2.6.5, Eclipse SDK 3.7.1, Pydev 2.3
I am trying to parse and change values in XML data in Python using xml.dom.minidom and I'm having an issue with blank text nodes.
When I ...
0
votes
1answer
23 views
XML parsing in python: expaterror not well-formed
I'm using Python's xml.etree.ElementTree to do some XML parsing on a file. However, I get this error mid-way through the document:
xml.parsers.expat.ExpatError: not well-formed (invalid token): line ...
1
vote
1answer
29 views
python ElementTree xml: parsing fromstring vs building elements
Given a large array of numbers where:
[1, 2, 3, 4 ...] => <tag attrib="1" />
<tag attrib="2" />
<tag attrib="3" />
...
0
votes
2answers
16 views
Iterate through xml to find url with specific extension with python
I have an xml file that I download from a url. I would then like to iterate through the xml to find the link to a file with a specific file extension.
My xml looks something like this:
<Foo>
...
4
votes
2answers
89 views
Parsing huge, badly encoded XML files in Python
I have been working on code that parses external XML-files. Some of these files are huge, up to gigabytes of data. Needless to say, these files need to be parsed as a stream because loading them into ...
1
vote
3answers
63 views
Processing XML in Python with ElementTree
I have a problem with ElementTree.iter().
So I tried this example in this link : http://eli.thegreenplace.net/2012/03/15/processing-xml-in-python-with-elementtree/
So here's what I've tried:
...
2
votes
2answers
40 views
parsing large xml file with Python - etree.parse error
Trying to parse the following Python file using the lxml.etree.iterparse function.
"sampleoutput.xml"
<item>
<title>Item 1</title>
<desc>Description 1</desc>
...
2
votes
2answers
46 views
getting javascript form content with python
I am a novice python programmer and I am having troubles finding a tool to help me get a form from a javascript. I have written a small script in python and also have a simple interface done in ...
0
votes
2answers
32 views
to display xml file through html page by hyperlinking it
I have created an app in django that searches the word entered by the user in 10 xml documents. As soon as he enters the word, for the results it is directed to the page that contains the list + ...
0
votes
2answers
28 views
Serializing form data - picke or XML?
I am trying to save form data, and I am wondering if I should use Python's native pickle, or some sort of XML serializer. I wanted to use django's serializers but these seem to be geared at working ...
1
vote
2answers
36 views
Feeding Blender an XML road file
My goal is to simulate traffic in a particular city. I'll be drawing cars using Blender and having them move about on lanes similar to a Manhattan configuration. All the information about the cars' ...