Add CSS Selector Example to XPATH Section #8
Comments
|
I think this can be closed as current version demonstrates CSS selectors |
|
Before closing this, do you think it is worth putting On a related note, one of the Key Points of demonstrates CSS selectors says |
|
good points. I'd rather only cover the All variant, as I consider it
essential to understand that a selector always evaluates to a list.
On the other hand, I'd consider not using the JavaScript console at all and
just use a visual tool that highlights selected elements. This could be
achieved with an existing browser extension, or with a simple bookmarker.
The advantage of the console is that it includes hidden elements and shows
their count.
…On 6 Jul 2017 3:48 am, "Lauren Ko" ***@***.***> wrote:
Before closing this, do you think it is worth putting querySelector into
the lesson? Currently, if one element is desired to be selected, the
examples show using querySelectorAll then selecting the first element
from the resulting list. querySelector could be used instead of
querySelectorAll or mentioned as an alternative on the
document.querySelectorAll("html > head > title")[0] example or on the Select
the blockquote titled “Overview” challenge or in the Class and ID
filtering section.
On a related note, one of the Key Points of demonstrates CSS selectors
<https://data-lessons.github.io/library-webscraping/02-csssel/> says CSS
selectors can be evaluated using the document.querySelector() function.
document.querySelectorAll() should probably be listed here instead (or in
addition if document.querySelector() gets worked into the episode).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz66l0Tsl0HyRdv2LjoRZkHfnIN-ERks5sK8xcgaJpZM4NtdZX>
.
|
In addition to using XPATH, also demonstrate document navigation in the browser console using
querySelectorandquerySelectorAllwith CSS selectors.The text was updated successfully, but these errors were encountered: