Closed washingon closed 9 years ago
I experience the same problem.
Apparently
(@page.at(".profile-picture img").attributes["src"].value.strip if @page.at(".profile-picture img"))
in profile.rb
fails. It looks like on some profiles the profile IMG tag is present, but it is missing the SRC attribute...
I did some more digging. On one of the problematic profiles I found this (this is the content of @page.at(".profile-picture img")
:
#<Nokogiri::XML::Element:0x2ad9dcaf0088 name="img" attributes=[
#<Nokogiri::XML::Attr:0x2ad9dceb8648 name="lazyload" value="true">,
#<Nokogiri::XML::Attr:0x2ad9dceb8634 name="class" value="image photo lazy-load">,
#<Nokogiri::XML::Attr:0x2ad9dceb8620 name="alt" value="XXXXsomeName">,
#<Nokogiri::XML::Attr:0x2ad9dceb860c name="data-delayed-url"
value="https://media.licdn.com/mpr/mpr/shrinknp_200_200/p/2/005/00b/2eb/16f4a3e.jpg">,
#<Nokogiri::XML::Attr:0x2ad9dceb85f8 name="width" value="200">,
#<Nokogiri::XML::Attr:0x2ad9dceb85e4 name="height" value="200">]>
They lazy-load pictures, so we will have to search for src
or data-delayed-url
attribute.
Can someone send a PR?
I am trying to create it. Unfortunately current HEAD does not work with my app, so I will have to first find out what's the problem. Probably renaming linkedin-scraper to linkedin_scraper broke something...
Ya, I recently renamed the files to follow Ruby conventions
OK - just a side note: after your rename, I had to add explicit :require => 'linkedin_scraper'
to my Gemfile. Apparently the name change killed bundler auto-loading..
The PR for this issue is ready.
some profiles have a problem with picture. puts profile.picture NoMethodError: undefined method `value' for nil:NilClass