Pregunta

I'm trying to make a bot, how can I read the value like the 1800 / 1800 from a website?

enter image description here

            Console.WriteLine("Health: ")
            Console.WriteLine("Energy: ")
            Console.WriteLine("Cash: ")
            Console.WriteLine("Level: ")

I'm making a console application, trying to get the value. Like if the health is lower then 1000/1800 then it's going to execute a send key. Like send the key "0" to the website.

Thanks, Prince

¿Fue útil?

Solución

HTML Agility Pack is a good and popular toolkit to scrape information from web pages.

This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).

For an introduction to using it have a look at:

http://runtingsproper.blogspot.com/2009/09/htmlagilitypack-article-series.html

If you get stuck at a particular step using it, by all means ask a new, detailed question on Stack Overflow.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top