Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traverse self only #2

Closed
marlonoso opened this issue Apr 16, 2015 · 1 comment
Closed

Traverse self only #2

marlonoso opened this issue Apr 16, 2015 · 1 comment

Comments

@marlonoso
Copy link

Hi
I need to compare two html for computing a ‘percentage tag matching similarity’ of doc2 related to doc1. For that purpose, its necessary to get the total amount of doc1 html tags, but the tdiff iterator yields doc1 + doc2 html tags

It is possible to traverse just the doc1 (self) object and returning when it's done?

@postmodern
Copy link
Owner

Sounds like you want to use Nokogiri's traverse method.

doc1.traverse do |node|
  ...
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants