data = container.find_all('div',class_='sppb-animated-number')
https://www.vfbank.ru/local/ajax/moneta.php?ELEMENT_ID=
import requests
from bs4 import BeautifulSoup
headers = {'user-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0',
}
url = 'https://www.vfbank.ru/local/ajax/moneta.php?ELEMENT_ID='
def parsing(_id):
response = requests.get(url+_id,headers=headers)
soup = BeautifulSoup(response.text,"html.parser")
title = soup.find('h3').text.strip()
full_content = soup.find('div',class_='coin-content__info coin-content-info coin-content-info--b-offset')
contents = full_content.find_all('div',class_='coin-content-info__item coin-content-info__item--b-offset')
print(title+'\n')
for content in contents:
_key = content.find('span',class_='coin-content-info__key').text.strip()
val = content.find('span',class_='coin-content-info__val').text.strip()
print(_key+' = '+ val)
parsing('370') # id монеты
import requests
from bs4 import BeautifulSoup
headers = {'user-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0',
'BX-ACTION-TYPE':'get_dynamic',
'BX-CACHE-MODE':'HTMLCACHE',
}
url = 'https://www.vfbank.ru/fizicheskim-licam/monety/pamyatnye-monety/'
def parsing(html):
start = html.find('bxdynamic_moneti_inner')
end = html.find("'HASH':'844584f9f4f7',")
data = html[start:end].replace('\\n','').replace('\\','')
soup = BeautifulSoup(data,"html.parser")
coins = soup.find_all('div',class_='col col--lg-6')
for coin in coins:
title = coin.find('a').text.strip()
_id = coin.find('a').get('data-id')
print(title,_id)
response = requests.get(url,headers=headers)
parsing(response.text)
'BX-ACTION-TYPE':'get_dynamic',
'BX-CACHE-MODE':'HTMLCACHE',