matthewmueller / x-ray

The next web scraper. See through the <html> noise.
MIT License
5.87k stars 349 forks source link

x promise then method not working #278

Closed edjroz closed 6 years ago

edjroz commented 6 years ago

Subject of the issue

Promise support not working ?

Your environment

Steps to reproduce

const Xray = require('x-ray');                                                                                  

const x = Xray();                                                                                               

x('https://blog.ycombinator.com', '.post', [{                                                                   
  title: 'h1 a',                                                                                                
  link: '.article-title@href'                                                                                   
}]).then(res => console.log(res));                                                                              

Expected behaviour

Should console log the array of news

Actual behaviour

TypeError: x(...).then is not a function

willisplummer commented 6 years ago

I'm getting the same result

alphardex commented 6 years ago

me, too :(

ghost commented 6 years ago

same problem !

dfcowell commented 6 years ago

Looks like this might be related to #277.

Can you try installing with the repo clone URI? That might be a workaround.

asaldivar commented 6 years ago

@dfcowell Installing with the repo clone URI worked for me.

tux-tn commented 6 years ago

Any update?

rbirkby commented 6 years ago

v2.3.2 (the current latest version on npmjs.org) was taken from a branch prior to Promise support being added. Promise support was committed to the tree prior to the 2.3.2 release, but the commits were not included in that release.

cbou commented 6 years ago

Would it be possible to release a new version? So that the last version include promises.

matthewmueller commented 6 years ago

sorry for the delay on this folks, just pushed 2.3.3!

cbou commented 6 years ago

Thanks.

Issue can be closed.

edjroz commented 6 years ago

It seems to be working. Thanks 😄