- CSS does not have a parent selector.
- cheerio has
has() selector.
Since we want Surgeon to work across different environment (i.e. browser), we'd need to implement this on the Surgeon level.
Use case
Sometimes it is required to know whether an element has a descending element to know if it is the right element, e.g. http://www.mk2.com/salles/mk2-gambetta.
To select all table rows that contain movie information, we can check if a table row includes information about the movie name.
#seances .l-mk2-tables .l-session-table .fiche-film-info::has(.fiche-film-title)
has()selector.Since we want Surgeon to work across different environment (i.e. browser), we'd need to implement this on the Surgeon level.
Use case
Sometimes it is required to know whether an element has a descending element to know if it is the right element, e.g. http://www.mk2.com/salles/mk2-gambetta.
To select all table rows that contain movie information, we can check if a table row includes information about the movie name.