# Selector syntax in the Cascadia package

**URL:** <https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287>\
**Category:** General Usage\
**Created:** [January 30, 2019, 6:06pm UTC](https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287 "2019-01-30T18:06:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [January 30, 2019, 6:06pm UTC](https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287/1 "2019-01-30T18:06:19Z")

</div>

I’m doing a bit of webscraping, patterned after that in the `DataDepsGenerators` package, using `Gumbo` and `Cascadia`. I don’t quite understand the syntax of the selector expressions in `Cascadia` and I haven’t been able to find any descriptions, either in `Cascadia.jl` or in the original package for `Go`. I want to select elements of the form

```julia
  <div id="articleTitle">
  <h3>
        Multimodal character viewpoint in quoted dialogue sequences
  </h3>
  </div>
  <div id="authorString">
      <em>
          Kashmiri Stec, Mike Huiskes, Martijn Wieling, Gisela Redeker
      </em>
  </div>

```

I can use something like

```julia
julia> first(eachmatch(Selector("""[id="authorString"]"""), art144.root))
HTMLElement{:div}:
<div id="authorString">
  <em>
    Kashmiri Stec, Mike Huiskes, Martijn Wieling, Gisela Redeker
  </em>
</div>

```

but that is just groping around in the dark if I don’t know the syntax.

---

<div class="post-metadata">

**Author:** ![dmbates](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmbates/32/44_2.png) [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Post date:** [January 30, 2019, 6:40pm UTC](https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287/2 "2019-01-30T18:40:09Z")

</div>

Okay I am beginning to understand that this is a [CSS selector syntax](https://www.w3schools.com/cssref/css_selectors.asp)

---

<div class="post-metadata">

**Author:** ![datnamer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datnamer/32/3471_2.png) [@datnamer](https://discourse.julialang.org/u/datnamer)\
**Post date:** [January 30, 2019, 8:51pm UTC](https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287/3 "2019-01-30T20:51:48Z")

</div>

Have you tried [https://github.com/bicycle1885/EzXML.jl](https://github.com/bicycle1885/EzXML.jl)
