將以下 xml 作為 elementTree 的輸入(使用 python 2.7): <body><div region="imageRegion" xml:id="img_SUB6756004155_0" ttm:role="caption" smpte:backgroundImage="#SUB6756004155_0"></body>我得到這個屬性:所以我需要找到以“backgroundImage”或“id”結尾的屬性通常我會這樣做: div.get('region')但在這里我只知道屬性名稱的一部分,是否可以使用正則表達式?
python elementTree 獲取以結尾的屬性
慕尼黑5688855
2021-10-12 16:33:26