yatish27 / linkedin-scraper

Scrapes the public profile of the linkedin page
MIT License
553 stars 221 forks source link

SocketError: getaddrinfo: Name or service not known #23

Closed GamalTawaf closed 9 years ago

GamalTawaf commented 10 years ago

Hi , when I use function current_positions and past_positions I always get this error :SocketError: getaddrinfo: Name or service not known all other function on that profile work fine. I do realize that it is making another call to get the page and it fails. How do I fix that ?

this is The trace for the error :

from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/socksify-1.5.0/lib/socksify.rb:172:in initialize' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/socksify-1.5.0/lib/socksify.rb:172:ininitialize' from /home/chinmay/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:879:in open' from /home/chinmay/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:879:inblock in connect' from /home/chinmay/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb:76:in timeout' from /home/chinmay/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:878:inconnect' from /home/chinmay/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:863:in do_start' from /home/chinmay/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:858:instart' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:700:in start' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:965:inreset' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:628:in connection_for' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:994:inrequest' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/mechanize-2.7.2/lib/mechanize/http/agent.rb:257:in fetch' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/mechanize-2.7.2/lib/mechanize.rb:432:inget' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/linkedin-scraper-0.1.1/lib/linkedin-scraper/profile.rb:180:in get_company_details' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/linkedin-scraper-0.1.1/lib/linkedin-scraper/profile.rb:166:inblock in get_companies' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:237:in block in each' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:236:inupto' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/nokogiri-1.6.1/lib/nokogiri/xml/node_set.rb:236:in each' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/linkedin-scraper-0.1.1/lib/linkedin-scraper/profile.rb:151:inget_companies' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/linkedin-scraper-0.1.1/lib/linkedin-scraper/profile.rb:69:in current_companies' from (irb):7 from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/commands/console.rb:90:instart' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/commands/console.rb:9:in start' from /home/chinmay/.rvm/gems/ruby-2.1.1/gems/railties-4.0.4/lib/rails/commands.rb:62:in<top (required)>' from bin/rails:4:in `require'

Thanks

yatish27 commented 9 years ago

There is no method as current_positions. Try to test on 0.1.5