serpapi / nokolexbor

High-performance HTML5 parser for Ruby based on Lexbor, with support for both CSS selectors and XPath.
218 stars 4 forks source link

`Nokolexbor::HTML` doesn't force conversion to String #4

Closed hartator closed 1 year ago

hartator commented 1 year ago

Getting an error when trying the Nokogiri's quickstart:

doc = Nokolexbor::HTML(URI.open('https://github.com/serpapi/nokolexbor'))
Exception: TypeError: no implicit conversion of Tempfile into String
--
 0: /Users/user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokolexbor-0.2.4/lib/nokolexbor.rb:15:in `parse'
 1: /Users/user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokolexbor-0.2.4/lib/nokolexbor.rb:15:in `HTML'
 2: (pry):1:in `<main>'

Nokolexbor::HTML probably just doesn't force conversion to String like Nokogiri::HTML does.

zyc9012 commented 1 year ago

Thanks @hartator 👍, the fix is included in the new version (0.2.5).