腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
Python
ElementTree
myroot.findall
()
、
我正在使用
Python
ElementTree
处理XML文件。应该是这样的: expr = "bla"expr = "bli" expr = "bla" 我写了这段代码: for type_tag in
myroot.findall
('
浏览 33
提问于2020-03-23
得票数 0
回答已采纳
4
回答
从XML解析名称/值对
、
、
</Account>我可以很容易地使用
python
解析这一点:myroot = mytree.getroot() mytree = et.parse(xml_path) for field in
myroot.findall
浏览 3
提问于2017-07-31
得票数 3
回答已采纳
1
回答
为什么我的xml解析器在
Python
3中不能按预期工作?
、
、
、
以下代码在
Python
2中运行良好。import xml.etree.
ElementTree
as ETimport json full_path = os.path.join('Test', file_name) myroot = tree.getroot()
浏览 5
提问于2021-08-09
得票数 1
1
回答
Python
- findall
、
、
、
、
我的档案是这样的:<root>for type_tag in
myroot.findall
('root/query'):以及如何打印所有的费用: for
浏览 4
提问于2020-04-01
得票数 0
回答已采纳
1
回答
在
python
中将XML数据解析为二维数组
、
、
、
我是
python
的新手,刚刚开始学习XML文件和二维数组。我正在尝试从xml文件中获取数据,并将其导入到
python
中的2D字符串数组中。import xml.etree.
ElementTree
as ETmyroot = mytree.getroot() FirstName = x.find('FirstName').t
浏览 34
提问于2020-07-11
得票数 0
2
回答
ElementTree
查找返回“无”?
、
我使用
ElementTree
与
Python
一起解析一个XML文件。<?xml version="1.0" encoding="UTF-8"?我的代码:myroot = mytree.getroot()for x in
myroot.findall
('c'):
浏览 8
提问于2020-03-21
得票数 2
回答已采纳
2
回答
Python
ElementTree
获取带有条件的上一个属性
、
、
我的文件是这样的: import xml.etree.
ElementTree
as ET <root> <a name='name1' label='label1'我有这样的代码: for type_tag in
myroot.findall
('.
浏览 20
提问于2020-04-21
得票数 1
回答已采纳
1
回答
如何从包含此属性的子元素中检索特定属性的所有值?
、
、
、
预期结果:这是我目前的代码:myroot = mytree.getroot()for n in list_nodes: #
浏览 6
提问于2022-04-18
得票数 1
回答已采纳
1
回答
Empyt Pandas数据帧
、
、
import xml.etree.
ElementTree
as ETimport pandas as pd image_id = myroot.find('filename').text for number_of_objects in
myroot.findall
浏览 6
提问于2020-08-06
得票数 0
回答已采纳
1
回答
以下两个套餐根据使用情况有何不同?
、
、
它们都包含库中的
ElementTree
.py程序from
elementtree
import
ElementTree
as
浏览 0
提问于2017-05-31
得票数 0
回答已采纳
2
回答
lxml.etree中未解析的导入字符串
、
Python
根本看不见它。你知道我做错了什么吗?
浏览 2
提问于2013-03-29
得票数 0
5
回答
在元素树中使用SimpleXMLTreeBuilder
、
、
我一直在使用django和
elementtree
开发一个应用程序,在将其部署到生产服务器时,我发现它正在运行
Python
2.4。我已经能够捆绑
elementtree
了,但是现在我得到了错误:不幸的是,我不能升级
python
浏览 4
提问于2009-07-01
得票数 6
回答已采纳
1
回答
使用IronPython时导入错误lxml
、
、
我在
python
上使用lxml模块成功解析了一个xml文件。
浏览 11
提问于2019-04-19
得票数 1
回答已采纳
4
回答
将
Python
ElementTree
转换为字符串
、
、
、
每当我调用
ElementTree
.tostring(e)时,我都会收到以下错误消息:是否有其他方法可以将
ElementTree
对象转换为XML字符串?TraceBack: File "Development/
Python
/REObjectSort/REObjectRes
浏览 4
提问于2013-03-09
得票数 97
回答已采纳
1
回答
将xml.etree.
ElementTree
转换为string会引发"TypeError:'int‘类型的参数不可迭代“
、
、
File "C:\Users\svascellar\AppData\Local\Programs\
Python
\
Python
36-32\lib\xml\etree\
ElementTree
.py", line(person)) File "C:\Us
浏览 1
提问于2018-03-05
得票数 3
回答已采纳
1
回答
如何修复导入
ElementTree
时出现的
Python
错误?
、
我开始学习
python
,这里我尝试使用
ElementTree
从xml文件中读取:from
elementtree
.
ElementTree
import
ElementTree
doc =
ElementTree
(file="test.xml")但是我得到这个错误:文件"my_xml.py",第2行,来自
elementtree
.
ElementTree</
浏览 1
提问于2010-11-16
得票数 7
回答已采纳
1
回答
识别
python
中损坏的.xml
、
我有一个小
python
脚本,它正在读取几个.XML文件。现在,我必须断言,这些.XML文件没有以任何方式损坏。我怎么查这个?
浏览 4
提问于2014-05-20
得票数 0
回答已采纳
3
回答
在Django中导入
python
模块时出错
、
、
、
在我的Django项目中,下面的代码行抛出一个ImportError:“没有名为
elementtree
的模块”。from
elementtree
import
ElementTree
但是,该模块已安装(即,我可以运行一个交互式
python
shell,输入没有任何ImportError的确切行),并且包含该模块的目录位于
浏览 1
提问于2009-09-03
得票数 3
回答已采纳
1
回答
将xml打印到控制台(xml.etree.
ElementTree
)
、
、
我需要将xml打印到控制台,这是我从响应中收到的:result = ET.
ElementTree
/2.7/lib/
python
2.7/xml/etree/
ElementTree
.py", line 1126, in tostring
ElementTree
(element).write(file, encodi
浏览 2
提问于2014-08-21
得票数 3
回答已采纳
1
回答
无法使用pip安装
elementtree
、
、
、
正在尝试使用pip安装
elementtree
包。
elementtree
1 location(s) to search forversions of
elementtree
: * https://pypi.
python
.org/simple/
elementtree</
浏览 2
提问于2016-01-02
得票数 14
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
热门
标签
更多标签
云服务器
ICP备案
对象存储
云直播
腾讯会议
活动推荐
运营活动
广告
关闭
领券