Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- instance_alink = root.find('{http://www.w3.org/2005/Atom}link')
- import xml.etree.cElementTree as ET
- tree = ET.parse('../../external_data/rss.xml')
- root = tree.getroot()
- instance_title = root.find('channel/title').text
- instance_link = root.find('channel/link').text
- instance_alink = root.find('{http://www.w3.org/2005/Atom}link')
- instance_description = root.find('channel/description').text
- instance_language = root.find('channel/language').text
- instance_pubDate = root.find('channel/pubDate').text
- instance_lastBuildDate = root.find('channel/lastBuildDate').text
- <?xml version="1.0" encoding="windows-1252"?>
- <rss version="2.0">
- <channel>
- <title>Filings containing financial statements tagged using the US GAAP or IFRS taxonomies.</title>
- <link>http://www.example.com</link>
- <atom:link href="http://www.example.com" rel="self" type="application/rss+xml" xmlns:atom="http://www.w3.org/2005/Atom"/>
- <description>This is a list of up to 200 of the latest filings containing financial statements tagged using the US GAAP or IFRS taxonomies, updated every 10 minutes.</description>
- <language>en-us</language>
- <pubDate>Mon, 20 Nov 2017 20:20:45 EST</pubDate>
- <lastBuildDate>Mon, 20 Nov 2017 20:20:45 EST</lastBuildDate>
- ....
- <atom:link href="http://www.example.com" rel="self" type="application/rss+xml" xmlns:atom="http://www.w3.org/2005/Atom"/>
- instance_alink = root.find('{http://www.w3.org/2005/Atom}link').attrib
Add Comment
Please, Sign In to add comment