0
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss">
<id>tag:blogger.com,1999:blog-5575774992011030841.archive</id>
<updated>2016-12-08T11:17:36.889+05:30</updated>
<title type="text">Rochak News</title>
<link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.rochaknews.com/feeds/archive">
<link rel="self" type="application/atom+xml" href="http://www.rochaknews.com/feeds/archive">
<link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="https://www.blogger.com/feeds/5575774992011030841/archive">
<link rel="alternate" type="text/html" href="http://www.rochaknews.com/">
<author>
<generator version="7.00" uri="https://www.blogger.com">Blogger</generator>
<entry>
<id>tag:blogger.com,1999:blog-5575774992011030841.settings.BLOG_BY_POST_ARCHIVING</id>
<published>2016-08-22T19:39:26.425+05:30</published>
<updated>2016-12-08T11:17:36.889+05:30</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#settings"></category>
<title type="text">Whether to provide an archive page for each post</title>
<content type="text">true</content>
<link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/5575774992011030841/settings/BLOG_BY_POST_ARCHIVING">
<link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/5575774992011030841/settings/BLOG_BY_POST_ARCHIVING">
<author>
</entry>
<entry></entry>
<entry></entry>
<entry></entry>
<entry>
<id>tag:blogger.com,1999:blog-5575774992011030841.post-1104181070415553676</id>
<published>2016-09-06T13:47:00.006+05:30</published>
<updated>2016-09-06T13:47:55.331+05:30</updated>
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/blogger/2008/kind#post"></category>
<category scheme="http://www.blogger.com/atom/ns#" term="Bollywood"></category>
<category scheme="http://www.blogger.com/atom/ns#" term="rochaknews"></category>
<title type="text">OMG ! प्रियंका और दीपिका के बाद अब हॉलीवुड जाएगी ये एक्ट्रेस</title>
<content type="html"><div dir="ltr" style="text-align: left;" trbidi="on"><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://3.bp.blogspot.com/-vBoYugcMUgc/V857M85aCkI/AAAAAAAAApY/vsIMDYcsy4AiVVxlkavmuG9wWl7mT8n1wCLcB/s1600/Sonam-kapoor-indian-fashion-pictures.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="384" src="https://3.bp.blogspot.com/-vBoYugcMUgc/V857M85aCkI/AAAAAAAAApY/vsIMDYcsy4AiVVxlkavmuG9wWl7mT8n1wCLcB/s640/Sonam-kapoor-indian-fashion-pictures.jpg" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br /><br />प्रियंका और दीपिका के बाद अब सोनम कपूर को भी लगा हॉलीवुड का चस्का। बॉलीवुड के बाद अब एक्ट्रेस सोनम कपूर हॉलीवुड में अपनी नयी जर्नी की शुरुआत करने जा रही हैं। स्टाइल डिवा सोनम अब हॉलीवुड फिल्मों में हाथ आज़माने जा रही हैं। सोनम ने इस बात की खबर खुद सोशल मीडिया पर ट्वीट के जरिये दी। उन्होने अपने फैंस को बताया की उन्हें यूनाइटेड टेलेंट एजेंसी ने सभी क्षेत्रों में प्रतिनिधित्व के लिए चुना है।<br /><br />हॉलीवुड में कपूर कोई पहला नाम नहीं है इससे पहले सोनम के पापा भी हॉलीवुड में ‘स्लमडॉग मिलेनियर’ और ‘मिशन इम्पॉसिबल: घोस्ट प्रोटोकॉल’ से अपनी एक्टिंग के जरिये कई दिल जीत चुके हैं। दीपिका पादुकोण और प्रियंका चोपड़ा के बाद अब सोनम भी हॉलीवुड अपने जलवे बिखेरने की तैयारी में हैं। फिलहाल सोनम अपनी नयी फिल्म ‘वीरे दी वैडिंग’ की शूटिंग में बिज़ि हैं।<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://1.bp.blogspot.com/-mPIxgYqcXSY/V857TD4J2NI/AAAAAAAAApc/bdPmebhpSMM1L7dPGYDfZtLJ-5Bbt7AswCLcB/s1600/hot%2Bsonam%2Bkapur.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="450" src="https://1.bp.blogspot.com/-mPIxgYqcXSY/V857TD4J2NI/AAAAAAAAApc/bdPmebhpSMM1L7dPGYDfZtLJ-5Bbt7AswCLcB/s640/hot%2Bsonam%2Bkapur.jpg" width="640" /></a></div><br /><a href="http://www.rochaknews.com/2016/09/blog-post_80.html">Read more: ब्रेस्ट इम्प्लांट' के कारण सुर्ख़ियों में आईं ये एक्ट्रेस</a><br /><a href="http://www.rochaknews.com/2016/09/blog-post_22.html">Read more:‘पॉर्न हब’ ने नेत्रहीनों के लिए लॉन्च किया एक खास चैनल</a><br /><a href="http://www.rochaknews.com/2016/08/blog-post_94.html">Read more: अय्याशी के लिए यहाँ मिलते है एक से बढ़ कर एक लड़कियां</a><br /><a href="http://www.rochaknews.com/2016/09/blog-post_69.html">Read more: जानिए, पुरुष बनाना चाहते है ऐसी महिलाओ से सम्बन्ध</a></div></content>
<link rel="replies" type="application/atom+xml" href="http://www.rochaknews.com/feeds/1104181070415553676/comments/default" title="टिप्पणियाँ भेजें">
<link rel="replies" type="text/html" href="http://www.rochaknews.com/2016/09/omg_6.html#comment-form" title="0 टिप्पणियाँ">
<link rel="edit" type="application/atom+xml" href="https://www.blogger.com/feeds/5575774992011030841/posts/default/1104181070415553676">
<link rel="self" type="application/atom+xml" href="https://www.blogger.com/feeds/5575774992011030841/posts/default/1104181070415553676">
<link rel="alternate" type="text/html" href="http://www.rochaknews.com/2016/09/omg_6.html" title="OMG ! प्रियंका और दीपिका के बाद अब हॉलीवुड जाएगी ये एक्ट्रेस">
<author>
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://3.bp.blogspot.com/-vBoYugcMUgc/V857M85aCkI/AAAAAAAAApY/vsIMDYcsy4AiVVxlkavmuG9wWl7mT8n1wCLcB/s72-c/Sonam-kapoor-indian-fashion-pictures.jpg" height="72" width="72"></media:thumbnail>
<thr:total>0</thr:total>
</entry>
<entry></entry>
</feed>
저는이 xml 파일을 파이썬으로 읽고 있습니다. 위 xml은 약간의 내용 만있는 샘플입니다. 기본적으로 <feed>
이고 자식은 <entry>
이고 하위 하위 범주는 <title>
, <published>
및 <content type="html">
입니다. <entry>
태그 중 일부만 콘텐츠 유형 = html입니다. <content type="html">
을 가진 <entry>
태그 만 읽고 싶습니다. 어떻게 읽을 수 있습니까?파이썬에서 xml을 읽는 방법?
import xml.etree.ElementTree as etree
tree = etree.parse('xmlread/template/blog-12-08-2016.xml')
entries = tree.findall('{http://www.w3.org/2005/Atom}entry')
print len(entries)
for child in entries:
title_element = child.find('{http://www.w3.org/2005/Atom}title')
published = child.find('{http://www.w3.org/2005/Atom}published')
# print published.text
# print title_element.text
그러나 전용 콘텐츠 유형 = "html로"이 특정 <entry>
태그를 읽을 수 없습니다 :
sugggest하십시오 나는 <entry>
하고 자식을 얻었다. 문제를 조사해주세요.