如何从一个网站看? [英] How can I read from a website?

查看:197
本文介绍了如何从一个网站看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让一个机器人,我如何从一个网站读起来就像1800年/ 1800年的价值?

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

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

我在做一个控制台应用程序,试图获得的价值。如果健康就好低则1800分之1000然后它会执行一个发送键。像发送键0到网站。

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.

谢谢,
王子

推荐答案

HTML敏捷性包是一个很好的和流行的工具包,从网页刮信息。

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

这是一个灵活的HTML解析器,建立一个读/写DOM,并支持简单的XPath或XSLT(你其实并不需要了解XPATH也不XSLT使用它,不要担心...)。这是一个.NET code库,使您解析出了网络的HTML文件。解析器很宽容与现实世界恶意的HTML。对象模型是非常相似,提出的System.Xml,但对于HTML文档(或流)。

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.

这篇关于如何从一个网站看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆