Created
April 11, 2023 16:08
-
-
Save allatambov/c0e4b30f0a71e76c65b3129fbe0d7604 to your computer and use it in GitHub Desktop.
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 | |
page = requests.get("https://cash.rbc.ru/") | |
soup = BeautifulSoup(page.text) | |
divs = soup.find_all("div", {"class" : "quote__office__one js-one-office"}) | |
d = divs[0] | |
link = d.find("a", {"class" : "quote__office__one__name"}) | |
name = link.text | |
href = link.get("href") | |
phone = d.find("div", {"class" : "quote__office__one__phone"}).text | |
buy = d.find("div", | |
{"class" : "quote__office__cell quote__office__one__rate quote__mode_list_view"}).text | |
buy = buy.strip() | |
sell = d.find("div", | |
{"class" : "quote__office__cell quote__office__one__sell js-filter-pro quote__mode_list_view_pro"}).text | |
sell = sell.strip() | |
metro = d.find("span", {"class" : None}).text | |
metro | |
distance = d.find("span", {"class" : "quote__office__metro__distance"}).text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment