xml.etree Questions

6

I am getting error while running "from lxml import tree" on python3.6 >>> import lxml >>> from lxml import etree Traceback (most recent call last): File "<stdin>", line 1, ...
Inseparable asked 21/11, 2018 at 6:50

2

I am trying to start a project using the Scrapy library, for a small webscraping project, but it fails on the import etree module. The exact error on the traceback is: from .. import etree ImportEr...
Melee asked 26/1, 2022 at 11:17

7

I want to use xpath in python . I tried import xml.etree.ElementTree as ET Since this library has limited usage I had to use lxml after a long session of search on google. I had several problems...
Biblio asked 30/4, 2013 at 9:4

7

Solved

How to clone Element objects in Python xml.etree? I'm trying to procedurally move and copy (then modify their attributes) nodes.
Geehan asked 23/10, 2010 at 20:43

4

I need help adjusting my XML file with Python and the elementTree library. For some background, I am not a student and work in industry. I hope to save myself a great deal of manual effort by makin...
Stableboy asked 20/5, 2016 at 0:1

8

I scrapped some html via xpath, that I then converted into an etree. Something similar to this: <td> text1 <a> link </a> text2 </td> but when I call element.text, I only...
Cliffcliffes asked 22/1, 2011 at 19:56

2

Solved

for this xml <Departments orgID="123" name="xmllist"> <Department> <orgID>124</orgID> <name>A</name> <type>type a</type> <status>Active&l...
Runnerup asked 13/2, 2014 at 6:9

1

Solved

I have a XML file: <sentence id="en_BlueRibbonSushi_478218345:2"> <text>It has great sushi and even better service.</text> </sentence> <sentence id="en_BlueRibbonSushi_...
Vapid asked 29/3, 2017 at 14:7

1

I have done a fair amount of reading on QName but I can't find any good examples of how to use it. Could someone give me a simple example of how to use QName and explain what context it would be us...
Separate asked 25/6, 2015 at 22:38

1

Solved

I need to force python(2.7.5) to use the word class in building a xml file properties = ET.SubElement(head, "properties", class="model.View$PropertyList") ^ SyntaxError: invalid syntax I tried...
Pulsifer asked 5/11, 2014 at 18:40

1

Solved

I am trying to extract the text value between two tags of an XML document with xml.etree.ElementTree. In the following example, that would be the values text two and text three. I can extract only ...
Expropriate asked 9/8, 2014 at 12:0

1

Solved

Is there a way to match multiple elements in a tree using .findall()? I would like to do this: trees = log.findall('element1' or 'element2') This is my work around (which works in my case becau...
Modify asked 21/7, 2014 at 17:38

1

I'm using python version 2.7.3. test.txt: <?xml version="1.0" encoding="UTF-8"?> <root> <test>The tag <StackOverflow> is good to bring up at parties.</test>...
Omni asked 7/5, 2014 at 11:33

2

Solved

So basically, I want to generate an XML with elements generated from data in a python dictionary, where what will come to be tags are the dictionary's keys, and the text the dictionary's values. I ...
Tophus asked 13/12, 2012 at 1:45

1

Solved

I'm trying to use Python 2.7's ElementTree library to parse an XML file, then replace specific element attributes with test data, then save this as a unique XML file. My idea for a solution was to...
Carrollcarronade asked 7/2, 2012 at 13:46

2

Solved

I can read tags, except when there is a prefix. I'm not having luck searching SO for a previous question. I need to read media:content. I tried image = node.find("media:content"). Rss input: <...
Beforetime asked 31/10, 2011 at 1:2
1

© 2022 - 2024 — McMap. All rights reserved.