0
나는 Crunchbase 페이지를 긁어하려고하지만 난이 오류가있어 SSLv3에 :기계화가`connect_nonblock '를 반환 SSL_connect 반환 = 1 개의 errno = 0 상태 =
require 'nokogiri'
require 'mechanize'
require 'json'
agent = Mechanize.new do |a|
a.ssl_version = :TLSv1
end
page = agent.get "https://www.crunchbase.com/app/search/people/0b543c0d8ea4c95cdf78a48583d501da2a76b26c"
member_links = page.links_with(href: %r{.*/person/\w+})
member_links.map do |link|
puts member_counter
member = link.click
# Get name
name = member.search('#profile_header_heading').text.strip
puts "#{name}"
end
: 아래
ryzal~/Desktop/Sites/scraper$ ruby scraper.rb
/Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert handshake failure (OpenSSL::SSL::SSLError)
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/http.rb:933:in `connect'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/http.rb:863:in `do_start'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/2.3.0/net/http.rb:858:in `start'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:700:in `start'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:631:in `connection_for'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/net-http-persistent-2.9.4/lib/net/http/persistent.rb:994:in `request'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mechanize-2.7.5/lib/mechanize/http/agent.rb:274:in `fetch'
from /Users/Ryzal/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mechanize-2.7.5/lib/mechanize.rb:464:in `get'
from scraper.rb:10:in `<main>'
코드입니다
Ruby Mechanize https error Mechanize getting "Errno::ECONNRESET: Connection reset by peer - SSL_connect"
:나는 이러한 솔루션을 모두 시도
하지만 여전히 같은 오류가 계속됩니다.
감사합니다.
다음 시도 내가 가지고'.../보석/기계화-2.7.5를/lib 디렉토리/기계화/HTTP/agent.rb : 323 : '가져 오기'에서 : 416 => 순 :: HTTPRequestedRangeNotSatisfiable for ... ' –
@RizalYusoff'Crunchbase '는 5 회의 요청 후 블록 IP입니다. 그래서 에러 코드'416'을 제공합니다. 해결책으로는 set proxy ip를 기계어로 사용해보십시오. –