Created
August 6, 2019 09:06
-
-
Save jamil666/7406b583504c903665b339f021b5e0c2 to your computer and use it in GitHub Desktop.
Parsing cbar.az currency and make dictionary with current values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
URL = 'https://www.cbar.az/currency/rates' | |
response = requests.get(URL) | |
soup = BeautifulSoup(response.content, 'html.parser') | |
codes = [] | |
values = [] | |
for code in soup.find_all(class_='kod'): | |
codes.append(code.text) | |
for value in soup.find_all(class_='kurs'): | |
values.append(value.text) | |
dictionary = dict(zip(codes, values)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment