-
Notifications
You must be signed in to change notification settings - Fork 129
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
Cannot set Mechanize page via Metadata's page method #42
Comments
@felipecsl I'm having the same problem here... @derantell did you ever resolved this? |
Same issue and gem versions same as derantell listed but on Linux 3.16 x86_64 instead. Did anyone else have this issue? I tried following - which works, but if someone has a better way, that would be great: module Wombat
module DSL
class Metadata
alias_method :mech_page_ref, :page
end
end
end and then used it as follows: data = Wombat.crawl do
mech_page_ref mech
end |
I just ran into this issue as well. The issue is that # cannot use Wombat#crawl
class Crawler
include Wombat::Crawler
og_image xpath: '//html/head/meta[@property = "og:image"]/@content'
twitter_image_src xpath: '//html/head/meta[@name = "twitter:image:src"]/@content'
end
crawler = Crawler.new
page = crawler.mechanize.get(uri.to_s)
crawler.metadata[:page] = page
result = crawler.crawl |
Workarounds are great and all that, but is there any chance to get it fixed in the project itself? |
When trying to use a pre-fethed Mechanize page as described in the wiki:
I get an error with this stack trace:
Using
@metadata_dup.page mp
or renamingMetadata::page
to something else works, therefore my guess is that theattr_accessor :page
whichCrawler
includes fromParser
is found andmethod_missing
is never invoked.Versions used:
ruby 2.1.2
,mechanize 2.7.3
andwombat 2.3.0
The text was updated successfully, but these errors were encountered: