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

artoo.saveImage seems to always error out with: "Uncaught TypeError: i.getExtension is not a function" #260

Open
kyle-wendling opened this issue Feb 7, 2017 · 7 comments
Labels

Comments

@kyle-wendling
Copy link

I've tried to trace back through minified spaghetti, looks like 'i' is Emmett instance, and it doesn't have this function?

artoo.saveImage('img',{filename:'test.jpg'});

Uncaught TypeError: i.getExtension is not a function
at o.artoo.saveImage (artoo-latest.min.js:2)
at :1:7

@Yomguithereal
Copy link
Member

That's a strange issue. Did you load the bookmarklet from the documentation's site? Emmet should be bundled with it.

@kyle-wendling
Copy link
Author

kyle-wendling commented Feb 8, 2017

Thanks for quick response, using latest bookmarklet (yesterday)
Pretty frustrating, savePageHtml works fine but no dice on saveImage, I could just be doing something wrong, but are you sure project isn't just in a broken state?

tracing it back from github source:
src/methods/artoo.methods.save.js
var ext = helpers.getExtension($sel.attr('src')),

var _root = this,
helpers = artoo.helpers;

but artoo.helpers as defined in artoo/src/artoo.helpers.js has no getExtension method?

repro: running on page: http://imgur.com/gallery/j2sqN

artoo.scrape('img[src*=OccRL0yr]','src');
["//i.imgur.com/OccRL0yr.jpg"]
artoo.saveImage('img[src*=OccRL0yr]',{filename:'test.jpg'});
artoo-latest.min.js:2 Uncaught TypeError: i.getExtension is not a function
    at o.artoo.saveImage (artoo-latest.min.js:2)
    at <anonymous>:1:7
artoo.saveImage @ artoo-latest.min.js:2
(anonymous) @ VM1358:1
artoo.saveImage('img',{filename:'test.jpg'});
artoo-latest.min.js:2 Uncaught TypeError: i.getExtension is not a function
    at o.artoo.saveImage (artoo-latest.min.js:2)
    at <anonymous>:1:7

@Yomguithereal
Copy link
Member

Well that's quite strange, I don't know why but this helper has indeed disappeared. I need to add it back. Can you ping me if I forget please?

@kyle-wendling
Copy link
Author

thanks, please LMK!

@Yomguithereal
Copy link
Member

Just released a v0.3.4 that should solve your issue. Be sure to empty your browser's cache and that the bookmarklet loads the correct version when loading artoo.

@kyle-wendling
Copy link
Author

thanks! I've implemented a more robust spider that can handle XHR request http errors, would you be interested in incorporating, should I sub a pull req?

jawas_42e63e07

@Yomguithereal
Copy link
Member

Can you show me your code or its documentation somehow?

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

No branches or pull requests

2 participants