Skip to content

Instantly share code, notes, and snippets.

@allatambov
Created April 11, 2023 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allatambov/c0e4b30f0a71e76c65b3129fbe0d7604 to your computer and use it in GitHub Desktop.
Save allatambov/c0e4b30f0a71e76c65b3129fbe0d7604 to your computer and use it in GitHub Desktop.
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