Web Scraping With Ruby
Introduction to web scraping with Ruby. How to handle http connections, parse html files for data, best practices, tips and an example project.
To get the name of the selected element in XPath the
name() function can be used. This function returns the name of the closest element in the current context.
name() function is useful in HTML parsing in broad selection cases like selecting multiple names. See this interactive example:
Above, we're selecting only paragraph and link elements by using wildcard match (the
* symbol) and a
name() matching predicate.