Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Web scraping
#4
Here a tips after taking a quick look at site.
Server status one image(icon) that push up and down based on server status.
Server-up has 'data-value': '1' server-down 'data-value': '8'.
Example first server.
from bs4 import BeautifulSoup
import requests

url = 'http://tera.enmasse.com/server-status'
url_get = requests.get(url)
soup = BeautifulSoup(url_get.content, 'lxml')
first = soup.select('.server-status-icon')
Test:
>>> first[0].attrs
{'class': ['server-status-icon'], 'data-value': '8'}
>>> first[0].attrs['data-value']
'8'
Reply


Messages In This Thread
Web scraping - by BoiledGoose - Jan-18-2018, 12:31 PM
RE: Web scraping - by j.crater - Jan-18-2018, 12:45 PM
RE: Web scraping - by metulburr - Jan-18-2018, 01:27 PM
RE: Web scraping - by snippsat - Jan-18-2018, 05:13 PM
RE: Web scraping - by BoiledGoose - Jan-20-2018, 03:24 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020