How to extract Twitch viewer count from WebBrowser control in VB.NET

I’m working on a VB.NET application where I need to capture the number of viewers from a Twitch stream page. My current approach involves using a WebBrowser control to load the stream page, but I’m having trouble figuring out how to extract the viewer count data and display it in a label on my form.

I’ve tried looking through various online resources but haven’t found a clear solution that works for my specific case. The viewer count information is displayed on the webpage, so I assume I need to parse the HTML content somehow, but I’m not sure about the best way to do this.

Has anyone successfully implemented something similar? Any guidance on how to access and retrieve this specific data from the loaded webpage would be really helpful. Thanks in advance for any suggestions or code examples you might have.

Had this exact problem six months ago building a stream monitoring tool. WebBrowser control works but it’s a nightmare to maintain - Twitch constantly updates their UI and loads everything with dynamic JavaScript. The viewer count doesn’t even show up on the initial page load, it comes through AJAX calls later. You’d have to use DocumentCompleted events and keep polling the DOM with GetElementById or GetElementsByClassName. Problem is, Twitch scrambles their CSS class names and changes them all the time. Mine broke three times in two months before I gave up. Just use the official Twitch API instead. Their Get Streams endpoint gives you accurate viewer data and it’s way more stable. You can hit it directly from VB.NET with WebClient or HttpClient. Yeah, you’ll need to register an app and deal with OAuth tokens, but it’s so much more reliable than parsing HTML and you get real-time data without loading entire webpages.

WebBrowser control works but you’ll need to parse HTML carefully. I built something like this for monitoring multiple streams at once. Wait for the page to load completely, then use Document.GetElementsByTagName or Document.GetElementsByClassName to find the viewer count element. Twitch usually puts viewer counts in specific div classes, but they change these without warning. Grab the InnerText and strip out any formatting characters. The tricky bit is the async loading - viewer counts update through JavaScript. You’ll probably need a timer that checks the DOM for updates regularly. Just heads up, expect maintenance headaches when Twitch changes their layout.

yeah, using the webbrowser control can b a hassle. their site updates often, which can mess up any scraping you do. it’s better to just go with their API - easier to get accurate viewer counts without all the stress.

Scraping Twitch viewer counts from web pages is a nightmare. The DOM changes constantly - you’ll be fixing it every few weeks when they update their frontend.

I hit this exact problem last year building a stream tracking dashboard. Started with web scraping but it broke so often I spent more time fixing than building.

Just automate it instead. Set up a workflow that pulls from Twitch API every few minutes and dumps the data where you need it. Hook it into your VB.NET app with webhooks or direct database connections.

Way more reliable than parsing HTML. You get clean JSON instead of wrestling with CSS selectors that randomly break.

Latenode makes the automation dead simple. Create a workflow that hits Twitch API, processes viewer data, and feeds your app automatically. No more WebBrowser control headaches.

Everyone’s right - WebBrowser is a nightmare. Hit the same wall building a dashboard for our gaming community last year.

The real problem isn’t parsing HTML. Twitch loads viewer counts through multiple API calls after the page renders. Even if your selectors work today, they’ll break when Twitch updates next week.

I fixed this with an automated pipeline that handles API calls and data processing outside the VB.NET app. It grabs viewer data every 30 seconds, processes it, and pushes clean results to my app through a simple HTTP endpoint.

No more DOM wrestling or timing headaches. Your VB.NET app just gets formatted data on demand. You can easily extend it to track multiple streamers or add historical data storage.

Set up the automation workflow with Latenode. It handles Twitch API complexity and feeds your app clean data automatically. Way cleaner than browser automation.

if ur gonna stick with webbrowser control, use invoke() to reach the document after loading. i normally wait like 3-4 secs post-documentcomplete, cause twitch uses js for viewer counts. search for span tags with the numbers, but fair warning - this method breaks a lot.