NoMethodError #297

Closed
travisjtodd opened this Issue Feb 28, 2013 · 3 comments

Projects

None yet

2 participants

@travisjtodd

I'm seeing when parsing images from Amazon.

NoMethodError: undefined method `path' for #<String:0x007fcfd1584460>
    from /Users/travisjtodd/.rvm/gems/ruby-1.9.3-p362/gems/mechanize-2.5.1/lib/mechanize/page/image.rb:65:in `extname'
    from /Users/travisjtodd/.rvm/gems/ruby-1.9.3-p362/gems/mechanize-2.5.1/lib/mechanize/page/image.rb:118:in `mime_type'
    from (irb):22
    from /Users/travisjtodd/.rvm/gems/ruby-1.9.3-p362/bundler/gems/rails-9d023c87de98/railties/lib/rails/commands/console.rb:88:in `start'
    from /Users/travisjtodd/.rvm/gems/ruby-1.9.3-p362/bundler/gems/rails-9d023c87de98/railties/lib/rails/commands/console.rb:9:in `start'
    from /Users/travisjtodd/.rvm/gems/ruby-1.9.3-p362/bundler/gems/rails-9d023c87de98/railties/lib/rails/commands.rb:64:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'
@leejarvis
Member

Can you show me an example I can reproduce this issue with?

@travisjtodd

Here's how I hit it:

uri = "http://www.amazon.com/Taylor-Dresses-Womens-Stripe-Flare/dp/B00ADHIME6/ref=lp_6059881011_1_2?ie=UTF8&qid=1362073987&sr=1-2"
@agent = Mechanize.new
@page = @agent.get(uri)
@page.images.last.extname
@leejarvis leejarvis closed this in 031b9e5 Mar 1, 2013
@leejarvis
Member

It looks like this breaks the build on Ruby 1.8.7 and 1.9.2 I don't have those versions available to me right now so I'll clean this up later

@leejarvis leejarvis reopened this Mar 1, 2013
@leejarvis leejarvis closed this Mar 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment