Ich habe einen HTML Quelltext von einer Website. Um genau zu sein von steamstat.us. Auf der Website wird der Status vom Steam Service in einigen Details angezeigt. Das ganze möchte ich in ein Programm einbinden. Und zwar soll angezeigt werden, wie viele Server z.B. in den USA online sind.
Auf der Website wird das ganze wie folgt angezeigt:
Im Quellcode steht diese Information in Zeile 54 ab Zeichen 39. Leider hab ich keine Ahnung von RegEx (Regular Expressions) und verpeil da so gut wie alles. Ich hatte vor die Information in einem Label anzugeben.
Danke im Vorraus, wenn mir jemand von euch weiterhelfen kann, da ich nach ewigem suchen nicht das gefunden habe, nachdem ich suche.
Code:
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Steam Status · Is Steam Down?</title>
<meta property="twitter:card" content="summary">
<meta property="twitter:site" content="@SteamDB">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Steam Status">
<meta property="og:title" content="Steam Status">
<meta property="description" content="Displays status of Steam client, Steam store, Steam community, Dota 2, TF2 and CSGO">
<meta property="og:description" content="Displays status of Steam client, Steam store, Steam community, Dota 2, TF2 and CSGO">
<meta property="og:image" content="http://steamstat.us/tile.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400&subset=latin">
<link rel="canonical" href="http://steamstat.us/">
<link rel="image_src" href="http://steamstat.us/tile.png">
<link rel="author" href="https://plus.google.com/112834339046661065024">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="apple-touch-icon" href="/tile.png">
<link rel="stylesheet" href="/freeman.css">
</head>
<body>
<div class="container">
<h1 class="title">Steam Services Status</h1>
<div class="info">
This website displays status of various Steam related services.
<hr>
<a href="http://steamdb.info/donate/">Click here if you wish to donate.</a> Your support is appreciated!
</div>
<div id="psa" style="display: none;"></div>
<div class="services">
<div id="loader" style="display: none;">
<span class="error" id="loader-error">Failed to load data.<br>Reload the page manually.</span>
<div class="spinner" id="loader-content">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
<div class="service" itemscope="">
<span class="name"><a href="http://steamdb.info/app/753/graphs/" target="_blank">Online<span class="hide-small"> on Steam</span></a> </span>
<span class="status good" id="online">5,771,281</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name">SteamDB Steam Client </span>
<span class="status good" id="steam">Normal <span class="time" title="Time since last status change">(10h)</span></span>
</div>
<div class="service" itemscope="">
<span class="name"><i class="flag flag-us"></i> United States </span>
<span class="status minor" id="cm-US">60 of 62 Servers Online</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name"><i class="flag"></i> Europe </span>
<span class="status good" id="cm-EU">38 Servers Online</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name"><i class="flag flag-cn"></i> China </span>
<span class="status good" id="cm-CN">24 Servers Online</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name"><i class="flag flag-nl"></i> Netherlands </span>
<span class="status good" id="cm-NL">12 Servers Online</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name"><i class="flag flag-au"></i> Australia </span>
<span class="status good" id="cm-AU">8 Servers Online</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name"><i class="flag flag-sg"></i> Singapore </span>
<span class="status good" id="cm-SG">6 Servers Online</span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<link itemprop="url" href="http://store.steampowered.com/">
<span class="name" itemprop="name">Steam Store </span>
<span class="status good" id="store">Normal <span class="time" title="Time since last status change">(15m)</span></span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<link itemprop="url" href="http://steamcommunity.com/">
<span class="name" itemprop="name">Steam Community </span>
<span class="status good" id="community">Normal <span class="time" title="Time since last status change">(2h)</span></span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name" itemprop="name">Steam Web API </span>
<span class="status good" id="webapi">Normal <span class="time" title="Time since last status change">(45m)</span></span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name" itemprop="name"><a href="http://steamdb.info/app/440/graphs/" target="_blank" title="Team Fortress 2">TF2</a> <span class="show-small">GC</span><span class="hide-small">Game Coordinator</span> </span>
<span class="status good" id="tf2">Normal <span class="time" title="Time since last status change">(15h)</span></span>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name" itemprop="name"><a href="http://steamdb.info/app/570/graphs/" target="_blank">Dota 2</a> <span class="show-small">GC</span><span class="hide-small">Game Coordinator</span> <a href="#dota_stats" class="caret" id="dota-button" title="Matchmaking stats"></a></span>
<span class="status good" id="dota2">Normal <span class="time" title="Time since last status change">(15h)</span></span>
</div>
<div class="mmstats services closed" id="dota-container">
<div class="service" itemscope="">
<span class="name">Players Searching </span>
<span class="status good" id="dota_mm_searching">37,682</span>
</div>
<div class="service" itemscope="">
<span class="name">Average Wait Time </span>
<span class="status good" id="dota_mm_average">146 seconds</span>
</div>
<div class="service" itemscope="">
<span class="name">Online Regions </span>
<span class="status major" id="dota_mm_regions">13 of 14</span>
</div>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<span class="name" itemprop="name"><a href="http://steamdb.info/app/730/graphs/" target="_blank" title="Counter-Strike: Global Offensive">CS:GO</a> <span class="show-small">GC</span><span class="hide-small">Game Coordinator</span> <a href="#csgo_stats" class="caret" id="csgo-button" title="Matchmaking stats"></a></span>
<span class="status good" id="csgo">Normal <span class="time" title="Time since last status change">(10h)</span></span>
</div>
<div class="mmstats services closed" id="csgo-container">
<div class="service" itemscope="">
<span class="name">Sessions Logon </span>
<span class="status good" id="csgo_sessions">Normal</span>
</div>
<div class="service" itemscope="">
<span class="name">Player Inventories </span>
<span class="status good" id="csgo_community">Normal</span>
</div>
<div class="service" itemscope="">
<span class="name">Matchmaking Scheduler </span>
<span class="status good" id="csgo_mm_scheduler">Normal</span>
</div>
<div class="service" itemscope="">
<span class="name">Players Searching </span>
<span class="status minor" id="csgo_mm_searching">2,441</span>
</div>
<div class="service" itemscope="">
<span class="name">Average Wait Time </span>
<span class="status minor" id="csgo_mm_average">67 seconds</span>
</div>
<div class="service" itemscope="">
<span class="name">EU West </span>
<span class="status good" id="csgo_dc_eu_west">Medium Load</span>
</div>
<div class="service" itemscope="">
<span class="name">EU East </span>
<span class="status good" id="csgo_dc_eu_east">Medium Load</span>
</div>
<div class="service" itemscope="">
<span class="name">EU North </span>
<span class="status good" id="csgo_dc_eu_north">Medium Load</span>
</div>
<div class="service" itemscope="">
<span class="name">US West </span>
<span class="status good" id="csgo_dc_us_west">Idle</span>
</div>
<div class="service" itemscope="">
<span class="name">US East </span>
<span class="status good" id="csgo_dc_us_east">Idle</span>
</div>
<div class="service" itemscope="">
<span class="name">Brazil </span>
<span class="status good" id="csgo_dc_br">Idle</span>
</div>
<div class="service" itemscope="">
<span class="name">Dubai </span>
<span class="status good" id="csgo_dc_dubai">Low Load</span>
</div>
<div class="service" itemscope="">
<span class="name">Singapore </span>
<span class="status minor" id="csgo_dc_singapore">High Load</span>
</div>
<div class="service" itemscope="">
<span class="name">Australia </span>
<span class="status good" id="csgo_dc_au">Low Load</span>
</div>
<div class="service" itemscope="">
<span class="name">South Africa </span>
<span class="status good" id="csgo_dc_sa">Medium Load</span>
</div>
</div>
<div class="service" itemscope="" itemtype="http://schema.org/Thing">
<link itemprop="url" href="http://steamdb.info/">
<span class="name" itemprop="name"><a href="http://steamdb.info/" target="_blank">SteamDB</a> Database </span>
<span class="status good" id="database">Normal <span class="time" title="Time since last status change">(≈1d)</span></span>
</div>
</div>
<div class="share">
<iframe src="https://platform.twitter.com/widgets/follow_button.html?dnt=true&screen_name=SteamDB&lang=en&show_count=false&show_screen_name=false&size=l" height="28" width="81" title="Follow"></iframe>
<iframe class="tweet-button hide-small" src="https://platform.twitter.com/widgets/tweet_button.html?count=none&dnt=true&lang=en&size=l&text=Check%20out%20%23Steam%20status%20on&url=http%3A%2F%2Fsteamstat.us&related=SteamDB" height="28" width="77" title="Tweet"></iframe>
<iframe class="flattr-button" src="https://api.flattr.com/button/view/?uid=SteamDB&button=compact&url=http%3A%2F%2Fsteamstat.us%2F" height="28" width="110" title="Flattr"></iframe>
</div>
<div class="footer">
Created by <a target="_blank" href="//xpaw.me">xPaw</a>.<br class="show-small"> This page refreshes every minute.
<div class="footer-attribution">
CM monitoring initially created by <a target="_blank" href="https://github.com/VoiDeD">VoiDeD</a>.<br>
Dota 2 stats provided by <a target="_blank" href="https://rjackson.me/tools/mmstats">RJackson</a>.
</div>
</div>
</div>
<script async="" src="https://www.google-analytics.com/analytics.js"></script><script>(function(f,m){try{var k,g,b,c,e,n,p=f.getElementById("loader"),d=f.getElementsByTagName("noscript")[0],h=f.getElementById("psa"),l=function(a){p.style.display="block";f.getElementById("loader-content").style.display="none";(d=f.getElementById("loader-error")).style.display="block";a&&(d.innerHTML=a)},q=function(){p.style.display="block";c=new XMLHttpRequest;c.open("GET","/status.json?"+60*Math.round(Date.now()/1E3/60),!0);c.onreadystatechange=s;c.ontimeout=function(){l("Request timed out.<br>Reload the page manually.")};
c.timeout=2E4;c.send()},s=function(){c=this;if(4===c.readyState){b=c.responseText;try{p.style.display="none";if(200!==c.status)return l(0);if(null===b||"{"!==b[0])return l("Received invalid data.<br>Is something wrong with your network?");b=JSON.parse(b);if(!b.success)return l(0);e=b.psa||"";n=Math.abs(Date.now()/1E3-b.time);300<n&&(e&&(e="<hr>"),e+="Data appears to be "+(0|n/60)+" minutes old.",3E3<n&&(e+=' <a href="http://time.is" target="_blank">Is your clock out of sync?</a>'));e?("block"!==h.style.display&&
(h.style.display="block"),h.innerHTML!==e&&(h.innerHTML=e)):"none"!==h.style.display&&(h.innerHTML="",h.style.display="none");b=b.services;for(k in b)if(d=f.getElementById(k))if(g=b[k],g.status&&(k="status "+g.status,d.className!==k&&(d.className=k)),g.time){var a=Date.now()-1E3*g.time;d.innerHTML=g.title+' <span class="time" title="Time since last status change">('+(6E4>a?"just now":36E5>a?Math.round(a/6E4)+"m":864E5>a?Math.round(a/36E5)+"h":2592E6>a?"\u2248"+Math.round(a/864E5)+"d":31536E6>a?"\u2248"+
Math.round(a/2592E6)+"m":"\u2248"+Math.round(a/31536E6)+"y")+")</span>"}else d.textContent?d.textContent=g.title:d.innerText=g.title;setTimeout(q,6E4)}catch(m){l(0),console.debug("Status:",c.status,c.statusText),console.debug("Data:",b)}}},r=function(a){var b="show_"+a,c=f.getElementById(a+"-container");m.getItem(b)&&(c.className="mmstats services");f.getElementById(a+"-button").addEventListener("click",function(a){try{a.preventDefault(),"mmstats services"===c.className?(c.className="mmstats services closed",
m.removeItem(b)):(c.className="mmstats services",m.setItem(b,1))}catch(d){}})};d&&d.parentNode.removeChild(d);q();m&&Element.prototype.addEventListener&&(r("csgo"),r("dota"))}catch(t){l("Something broke.<br>Are you using an outdated browser?"),console.error(t)}})(document,localStorage);</script>
<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create','UA-37177069-4','steamstat.us');ga('set','forceSSL',true);ga('send','pageview');</script>
</body></html>






wenn du verschiedene Sachen von einer Seite auslesen möchtest. Beispiel: