VB.NET在HTML字符之间提取文本

时间:2018-03-18 12:06:48

标签: regex vb.net

所以我创建了一个应用程序,它会在您成功登录后为您提供Spotify帐户等的统计信息,我正在尝试从https://spotify.com/account/subscription/页面确定您的订阅状态。

Dim Info As Match = Regex.Match(html, "<h3 class=""product-name"">(\d+)</h3>")
Label3.Text = "Account Type: " + Info.Groups(1).Value

在将Info.Groups(1).Value的结果写入控制台时,我得到一个空白,关于如何获取<h3></h3>之间的值的任何想法?

1 个答案:

答案 0 :(得分:0)

这将为您提供<h3></h3>

之间的值
Dim Info As Match = Regex.Match(html, "<h3.*>(.*)<\/h3>")
Label3.Text = "Account Type: " + Info.Groups(1).Value
相关问题