Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Add Comment
Please, Sign In to add comment