Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Watir-Nokogiri is an HTML parser using Watir's API.
Watir (classic and webdriver) can have performance issues when parsing large HTML pages. One solution has been to extract the page's HTML using Watir and then parse the HTML with an HTML parser (ex Nokogiri). This required learning two APIs - Watir and the HTML parser. Watir-Nokogiri eliminates the need to learn an HTML parser API by applying the Watir API to the HTML parser Nokogiri.
gem install 'watir-nokogiri'
To use Watir-Nokogiri:
require 'watir-nokogiri'
Watir-Nokogiri can parse a string containing HTML.
This is typically supplied by a Watir browser:
doc = WatirNokogiri::Document.new(browser.html)
However, you can also read from a file:
doc = WatirNokogiri::Document.start('C:\some_file.html')
With the parsed document, you can use the standard Watir API to locate elements and validate text/attributes.
Check if an element exists
doc.div(:id => 'my_id').exists?
Get the text of an element
doc.span(:id => 'my_span').text
Get an attribute value of an element
doc.span(:id => 'my_span').attribute_value('name')
Count the number of elements
doc.text_fields.length
FAQs
Unknown package
We found that watir-nokogiri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.