(** *) #r "nuget: FSharp.Data,6.6.0" #endif (** [![Binder](../img/badge-binder.svg)](https://mybinder.org/v2/gh/fsprojects/FSharp.Data/gh-pages?filepath=library/HtmlCssSelectors.ipynb)  [![Script](../img/badge-script.svg)](https://fsprojects.github.io/FSharp.Data//library/HtmlCssSelectors.fsx)  [![Notebook](../img/badge-notebook.svg)](https://fsprojects.github.io/FSharp.Data//library/HtmlCssSelectors.ipynb) # HTML CSS selectors This article demonstrates how to use HTML CSS selectors to browse the DOM of parsed HTML files. We use the [HtmlDocument](https://fsprojects.github.io/FSharp.Data/reference/fsharp-data-htmldocument.html) type and associated [HtmlDocument](https://fsprojects.github.io/FSharp.Data/reference/fsharp-data-htmldocumentmodule.html) module and [HtmlDocumentExtensions](https://fsprojects.github.io/FSharp.Data/reference/fsharp-data-htmldocumentextensions.html) extensions. The usage of CSS selectors is a very natural way to parse HTML when we come from Web developments. The HTML CSS selectors are based on the [JQuery selectors](https://api.jquery.com/category/selectors/). To use CSS selectors, reference the FSharp.Data package. You then need to open `FSharp.Data` namespace, which automatically exposes extension methods that implement the CSS selectors. *) open FSharp.Data (** ## Practice 1: Search for FSharp.Data on Google We will parse links of a Google to search for `FSharp.Data` like in the [HTML Parser](HtmlParser.html) article. *) let googleUrl = "http://www.google.co.uk/search?q=FSharp.Data" let doc = HtmlDocument.Load(googleUrl)(* output: val googleUrl: string = "http://www.google.co.uk/search?q=FSharp.Data" val doc: HtmlDocument = Google Search