简体   繁体   English

使用VB或C#从HTML获取值并编写文本文件

[英]Get a value from HTML with VB or C# and write text file

I'd like to develop a script or program that gets a value from an HTML page (from a table) and puts it into a text file. 我想开发一个脚本或程序,该脚本或程序从HTML页面(从表)获取值并将其放入文本文件。 I want to use Visual Basic or C#. 我想使用Visual Basic或C#。

I'm really new into this so I don't really know how to start it. 我真的很陌生,所以我真的不知道如何开始。 Do you guys have any ideas? 你们有什么主意吗? What could help me to get those values. 是什么可以帮助我获得这些价值。

I need the hours (37 h). 我需要几个小时(37小时)。

<tr>
  <th nowrap class="item_nm1">Lamptime</th>
  <td nowrap class="item_nm1"<div align="left">37 h</div></td>
</tr>

Take a look at the Html Agility Pack , which is a C# framework which will allow you to parse HTML documents and act unto them. 看一下Html Agility Pack ,它是一个C#框架,可让您解析HTML文档并对其执行操作。

This tutorial should put you on the right track. 教程应该使您走上正确的道路。

Alternatively, you could also take a look at Selenium , which provides a C# DLL which allows you to build C# web scrapers, as shown here . 或者,你也可以看看 ,它提供了一个C#DLL,它允许你建立C#网络刮削器,如图所示这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM