lorien / awesome-web-scraping

List of libraries, tools and APIs for web scraping and data processing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

equivalent-xml gem

wmene opened this issue · comments

commented

Awesome gem to check equivalency between xml documents or nodes. Has built in Rspec matchers so you can write specs like this:

expect(node_1).to be_equivalent_to(node_2)

How could it be useful in web scraping process?

commented

It could be used to compare xml documents without regards to element or attribute order, similar to what the JsonCompare gem you list does for Json. Here's an example:

require 'equivalent-xml'

xml1 = '<a><b/><c/></a>'
xml2 = '<a><b/><c/></a>'
EquivalentXml.equivalent? xml1, xml2
=> true

OK, I've added it. Thank you :)