View difference between Paste ID: v5Zh7B5h and NUUK0ZZh
SHOW: | | - or go back to the newest paste.
1
import urllib.request
2
from bs4 import BeautifulSoup
3
import datetime
4
5
dt = datetime.datetime.now()
6
data = dt.strftime('%d/%m/%Y')
7
8
def get_xml(url):
9
    response = urllib.request.urlopen(url)
10-
    print(soup.prettify())
10+
11
12-
    parse(get_xml('http://www.cbr.ru/scripts/XML_daily.asp?date_req=02/03/2002'))
12+
13
    soup = BeautifulSoup(xml)
14
    rows = soup.find_all(id="R01235")
15
    print(rows)
16
def main():
17
    parse(get_xml('http://www.cbr.ru/scripts/XML_daily.asp?date_req='+data))
18
19
if __name__ == '__main__':
20
    main()