Created
April 25, 2021 23:25
-
-
Save fabiogaluppo/e3432c11f539dfda95c4c0b56672b01c to your computer and use it in GitHub Desktop.
Web Scraping "Mega Sena" with F# Data Providers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Data | |
[<Literal>] | |
let MegaSena_Url = "http://loterias.caixa.gov.br/wps/portal/loterias/landing/megasena/!ut/p/a1/04_Sj9CPykssy0xPLMnMz0vMAfGjzOLNDH0MPAzcDbwMPI0sDBxNXAOMwrzCjA0sjIEKIoEKnN0dPUzMfQwMDEwsjAw8XZw8XMwtfQ0MPM2I02-AAzgaENIfrh-FqsQ9wNnUwNHfxcnSwBgIDUyhCvA5EawAjxsKckMjDDI9FQE-F4ca/dl5/d5/L2dBISEvZ0FBIS9nQSEh/pw/Z7_HGK818G0K8DBC0QPVN93KQ10G1/res/id=historicoHTML/c=cacheLevelPage/=/" | |
type MegaSena_Results = HtmlProvider<MegaSena_Url, PreferOptionals=true> | |
let instanceMegaSena = MegaSena_Results.GetSample() | |
let data = instanceMegaSena.Tables.Table1 | |
for x in data.Rows do | |
if x.Column1.IsSome then | |
printfn "%d %d %d %d %d %d" x.Column4.Value x.Column5.Value x.Column6.Value x.Column7.Value x.Column8.Value x.Column9.Value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment