Ruby Mechanize https error

前端 未结 1 517
难免孤独
难免孤独 2020-12-31 07:20

I\'m trying to do the following:

page = Mechanize.new.get \"https://sis-app.sph.harvard.edu:9030/prod/bwckschd.p_disp_dyn_sched\"

But I onl

相关标签:
1条回答
  • 2020-12-31 08:00

    Sometimes you need to tell mechanize to use sslv3:

    page = Mechanize.new{|a| a.ssl_version, a.verify_mode = 'SSLv3', OpenSSL::SSL::VERIFY_NONE}.get "https://sis-app.sph.harvard.edu:9030/prod/bwckschd.p_disp_dyn_sched"
    

    Notice that I use OpenSSL::SSL::VERIFY_NONE. That means you are theoretically vulnerable to man-in-the-middle attack, but that's not something I generally worry about when I'm scraping a website.

    0 讨论(0)
提交回复
热议问题