node-boilerpipe icon indicating copy to clipboard operation
node-boilerpipe copied to clipboard

Error on fulltext extraction

Open yanosh-igor opened this issue 10 years ago • 3 comments

I'm running my script that use boilerpipe and after some time I'm getting this error:

Boilerpipe error: Error: Error running instance method
java.lang.NullPointerException
        at de.l3s.boilerpipe.filters.heuristics.SimpleBlockFusionProcessor.proce
ss(SimpleBlockFusionProcessor.java:45)
        at de.l3s.boilerpipe.extractors.DefaultExtractor.process(DefaultExtracto
r.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)

I'm using this code:

getText = (html, callback)->
  unless html
    callback(false)
  else
    boilerpipe = new Boilerpipe(
      html: html
    , (err) ->
      util.log 'Boilerpipe error: ' + err if err
    )
    boilerpipe.getText((err, text)->
      if text?
        callback text
      else
        callback(false)
    )

My function "getText()" running in the loop. Could you please suggest something?

Also would be great to have some method that will set HTML/URL and in callback return text. In this case I won't need to create objects in the loop.

yanosh-igor avatar Mar 03 '15 10:03 yanosh-igor

I am runnign into the same problem. Any fixes yet?

fawind avatar Jun 25 '15 15:06 fawind

I guess this is still an open issue?

jeffj avatar Sep 02 '15 00:09 jeffj

I got this error, finally figured out 'html' was an object. Ensure html is a string before passing it in.

zdrd avatar Oct 21 '16 04:10 zdrd