import bs4
import requests
from bs4 import BeautifulSoup
url = 'https://eth.nanopool.org/'
page = requests.get(url)
soup = BeautifulSoup(page.text, features="html.parser")
allNews = soup.findAll('div', class_='col-lg-2 text-center')
for data in allNews:
data.findAll('div', class_ = 'panel-body')
print(data.getText())
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1370 0 1370 0 0 4598 0 --:--:-- --:--:-- --:--:-- 4612
{
"data": [
{
"block_number": 14384879,
"date": 1647263052,
"hash": "0x72d3a499e38b26a7ac6f77955a5aad3c824e39794c2b649c32f6d8ec7bcbc416",
"miner": null,
"status": 11,
"value": 1.75
},
{
"block_number": 14384870,
"date": 1647262953,
"hash": "0x1563ee582ffd0a7ed7dbf3e09b894003ae9e13cda6f12ef17428a0c1e4f1f3d0",
"miner": "0x8bc7a21a1f3a2d3e9ae872077765a0e6f59c7822",
"status": 1,
"value": 2.03091155084
},
{
"block_number": 14384852,
"date": 1647262735,
"hash": "0x7a13f3a686db6dae25f0ab8507efffdd869ad26a90e9f2c74d779957c6f9b628",
"miner": "0x11bad4e093b8fb9f951dca8e5ec9474694ad4d6e",
"status": 1,
"value": 2.14722100253
},
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from bs4 import BeautifulSoup
options = Options()
options.headless = True
driver = webdriver.Chrome(options=options)
URL = 'https://eth.nanopool.org/'
driver.get(URL)
html = driver.page_source
time.sleep(5)
soup = BeautifulSoup(html, 'lxml')
data = soup.find_all('div', class_='panel panel-primary fixed-height-panel')
for elem in data:
elem_title = elem.find('div', class_='panel-title').text
elem_value = elem.find('div', class_='panel-body').text
print(f'{elem_title}: {elem_value}')