f#-data - F# - 使用 HtmlProvider 加载最后一行为空的表时出错
问题描述
使用 HtmlProvider 加载 Wikipedia 表时,我收到一条错误消息,因为表中的最后一行是空的!
module SOQN =
open System
open FSharp.Data
let [<Literal>] wikiUrl = @"https://en.wikipedia.org/wiki/COVID-19_testing#Virus_testing_statistics_by_country"
type Covid = HtmlProvider<wikiUrl>
let main() =
printfn ""
printfn "SOQN: Error Loading Table With Empty Last Row Using HtmlProvider?"
printfn ""
let feed = Covid.Load(wikiUrl)
feed.Tables.``Virus testing statistics by country``.Rows
|> Seq.map (fun r -> r.Date)
|> printf "%A "
printfn ""
0
[<EntryPoint>]
main() |> ignore
printfn "Fini!"
printfn ""
// Actual Output:
// "Date is missing"
//
// Expected Output:
// seq [ "Albania"; "19 Apr"; "5542"; "562"; "10.1"; "1,936"; "196"; "[121]" ]
// ...
//
我错过了什么?
例如,我可以将列类型预设为“字符串”,类似于在 CsvProvider 中使用“模式”吗?
解决方案
推荐阅读
- mysql - 如何在 CTE 上的 MySQL 中运行更新查询?
- javascript - 如何检查字符串中是否包含数字
- android - 如何为 Unity 项目运行 AppsFlyer SDK 集成测试?
- laravel - 错误: Composer\Downloader\TransportException 我尝试安装 Laravel
- java - 如何将 csv 文件转换为 ByteArrayResource
- c++ - 编译器是否被迫根据模板参数评估 if 表达式?
- visual-studio - VS2019 + Clang 无法打开'libboost_date_time-clangw10-mt-gd-x32-1_73.lib':没有这样的文件或目录
- mysql - 当数据集中 2 个数据表中的 1 个返回空行时,Crystal Report 不显示数据
- apache-spark - 将 KAFKA json 消息转换为案例类,并使用 RDD 方法使用 play json 将其保存到 Cassandra
- javascript - 如何使用地图功能的承诺在javascript中同步运行?