Ich würde gerne ein paar daten von einem lokalen Server auslesen. Ich habe keine Ahnung von Regex oder Quellcode aber das mir Regex ausspuckt was ich suche klappt. Das Problem ist eher das ich im Quellcode nicht die Werte finde die ich auslesen möchte.
Hier mal der Quellcode:
<html><head><style>body { background-color: #2E2E2E; color: white; text-align: center; font-family: Arial, sans-serif; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; margin: 0; }h1 { margin-top: 50px; }table { margin: 0 auto; border-collapse: collapse; width: 80%; max-width: 100%; }th, td { border: 1px solid white; padding: 10px; text-align: center; white-space: nowrap; }#header { display: flex; justify-content: space-between; width: 80%; max-width: 100%; margin: 0 auto; }#timeMining { text-align: left; }#version { text-align: right; }#container { text-align: center; width: 100%; padding: 10px; box-sizing: border-box; position: relative; }#footer { position: fixed; bottom: 0; left: 0; width: 100%; text-align: center; padding: 10px 0; background-color: #2E2E2E; }#footer a { color: #00FF00; text-decoration: none; }#footer p { color: white; margin: 0; }td { color: green; }@media (max-width: 600px) { th, td { font-size: 12px; padding: 5px; } #header { flex-direction: column; align-items: center; } #timeMining, #version { text-align: center; margin-top: 10px; } }</style></head><body><div id='container'><h1>NMMiner Web Monitor</h1><div id='header'><div id='timeMining'></div><div id='version'>Version: v0.3.04</div></div><table><tr><th>Hash Rate</th><th>Share(R/A)</th><th>Net Diff</th><th>Pool Diff</th><th>Last Diff</th><th>Best Diff</th><th>Valid</th><th>Progress</th><th>Temperature</th><th>RSSI</th><th>Free Heap</th></tr><tr><td id='hashRate'></td><td id='shares'></td><td id='netDiff'></td><td id='poolDiff'></td><td id='lastDiff'></td><td id='bestDiff'></td><td id='valid'></td><td id='progress'></td><td id='temp'></td><td id='rssi'></td><td id='freeHeap'></td></tr></table><div id='footer'><p>© 2024 NMMiner | <a href='https://github.com/NMminer1024/NMMiner' target='_blank' rel='noopener noreferrer'>GitHub</a></p></div></div><script>function fetchData() { fetch('/data').then(response => response.json()).then(data => { document.getElementById('timeMining').innerText = 'Up Time: ' + data.timeMining; document.getElementById('hashRate').innerText = data.hashRate; document.getElementById('shares').innerText = data.shares; document.getElementById('netDiff').innerText = data.netDiff; document.getElementById('poolDiff').innerText = data.poolDiff; document.getElementById('lastDiff').innerText = data.lastDiff; document.getElementById('bestDiff').innerText = data.bestDiff; document.getElementById('valid').innerText = data.valid; document.getElementById('progress').innerText = data.progress; document.getElementById('temp').innerText = data.temp; document.getElementById('rssi').innerText = data.rssi; document.getElementById('freeHeap').innerText = data.freeHeap; });}setInterval(fetchData, 1000);fetchData();</script></body></html>
Ich möchte eben diese 0 von Valid auslesen, wie gesagt finde ich das Valid aber eben nicht den Wert 0 dazu