Extracting Structure from HTML using Adam's dom.d

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 22 03:40:52 PST 2015


On Thursday, 22 January 2015 at 11:23:49 UTC, Nordlöw wrote:
> What is the meaning of selectors such as
>
>     `a[href]`
>
> used in
>
>     doc.querySelectorAll(`a[href]`)
>
> ?

Select all `a` tags that have a `href` attribute.

You can also select using the attribute value too. For example 
get all the text inputs in a form:

doc.querySelectorAll(`form[name="myform"] input[type="text"]`)

dom.d is awesome!


More information about the Digitalmars-d-learn mailing list