【问题标题】:F# count all present links on html websiteF#计算html网站上所有存在的链接
【发布时间】:2021-03-10 17:20:35
【问题描述】:

我目前正在尝试创建一个简单的 F# 函数,它可以给一个 html 站点的 URL,计算所有存在的链接。

我知道可以通过计算

非常感谢任何帮助。

【问题讨论】:

  • 到目前为止你尝试了什么?
  • 我现在已经开始工作了

标签: html web web-scraping f# substring


【解决方案1】:

您可以使用FSharp.Data 包中的HtmlParser

open FSharp.Data

let doc = HtmlDocument.Load "https://en.wikipedia.org/wiki/F_Sharp_(programming_language)"

let linksCount = doc.Descendants ["a"] |> Seq.length

【讨论】:

    猜你喜欢
    • 2011-11-27
    • 2019-02-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-28
    • 2014-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多