1
vote
3answers
27 views

How do I parse some of the data from a large xml file?

I need to extract the location and radius data from a large xml file that is formatted as below and store the data in 2-dimensional ndarray. This is my first time using Python and I can't find ...
0
votes
1answer
42 views

Mapping user id onto a dict comparing to see if user is already in dict

I have code which currently prints out data for each user from an XML file (obtained from a website) the XML updates as more users interact with it throughout the day. I currently have my code looping ...
-2
votes
1answer
20 views

Merging XML files using python

I have two XML files: The first one contains the following tags: <book id=1> <chpater id=1> <sentence id = 1> blaa blaa blaa blaa </sentence> <sentence id = 2> blaa ...
1
vote
0answers
30 views

Read XML file like text file

is there any way to read xml file like reading text file(line by line)? In my work for some cases i have to read only specific lines. I'm using minidom for parsing xml.
0
votes
2answers
18 views

Grab Content from XML using Python? almost there

I'm using ElementTree and I can get tags and attributes but not that actual content between elements. from this XML: <tag_name attrib="1">I WANT THIS INFO HERE</tag_name> here's my ...
0
votes
2answers
34 views

How to find the character position of something specified with a <tag>…</>? Python

I am trying to get the position of the < and > that are realtag when they are embedded in something like this <tag "510270">calculate</>. I have sentences like these: sentence = ...
1
vote
1answer
38 views

Parsing xml to pandas data frame throws memory error

I am trying to put 1. a parent attribute 2. a child attribute and 3. a grandchild text into a data frame. I am able to get the child attribute and the grandchild text to print out on the screen, but I ...
0
votes
1answer
1k views

Easiest way to send XML via HTTP requests in Python?

Is there a preferred python module that could help me to send XML through a HTTP request and be able to parse the returning XML?
4
votes
6answers
7k views

Python code to remove HTML tags from a string

I have a text like this: text = """<div> <h1>Title</h1> <p>A long text........ </p> <a href=""> a link </a> </div>""" using pure Python, with no ...
7
votes
2answers
3k views

Supressing namespace prefixes in ElementTree 1.2

In python 2.7 (with etree 1.3), I can suppress the XML prefixes on elements like this: Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build ...
4
votes
2answers
5k views

How to select following sibling/xml tag using xpath

I have an HTML file (from Newegg) and their HTML is organized like below. All of the data in their specifications table is 'desc' while the titles of each section are in 'name.' Below are two ...
111
votes
7answers
76k views

How do I parse XML in python?

I have many rows in a database that contain xml and I'm trying to write a python script that will go through those rows and count how many instances of a particular node attribute show up. For ...
98
votes
10answers
40k views

Pretty printing XML in python

What is the best way (or even the various ways) to pretty print xml in python?
4
votes
2answers
8k views

xml.dom.minidom: Getting CDATA values

I'm able to get the value in the image tag (see XML below), but not the Category tag. The difference is one is a CDATA section and the other is just a string. Any help would be appreciated. from ...
19
votes
6answers
14k views

What is the fastest way to parse large XML docs in Python?

I am currently the following code based on Chapter 12.5 of the Python Cookbook: from xml.parsers import expat class Element(object): def __init__(self, name, attributes): self.name = ...

1 2 3 4 5 132
15 30 50 per page