Open JmyL opened 7 years ago
흠... 영어는 좀 아닌 듯 ㅋㅋㅋ
가져와야 하는 https://www.biblegateway.com/passage/?search=gen1&version=ESV 페이지의 contents는 다음과 같습니다.
<p class="chapter-1">
<span class="text Gen-1-1">
<span class="chapternum">1 </span>
In the <sup class='crossreference' data-link='(<a href="#cen-ESV-1A" title="See cross-reference A">A</a>)' data-cr='#cen-ESV-1A'></sup>beginning, God created the heavens and the earth.
</span>
<span id="en-ESV-2" class="text Gen-1-2">
<sup class="versenum">2 </sup>The earth was <sup class='crossreference' data-link='(<a href="#cen-ESV-2B" title="See cross-reference B">B</a>)' data-cr='#cen-ESV-2B'></sup>without form and void, and darkness was over the face of the deep. And the Spirit of God was hovering over the face of the waters.
</span>
</p>
<p>
<span id="en-ESV-3" class="text Gen-1-3">
<sup class="versenum">3 </sup>And God said, <sup class='crossreference' data-link='(<a href="#cen-ESV-3C" title="See cross-reference C">C</a>)' data-cr='#cen-ESV-3C'></sup>“Let there be light,” and there was light.
</span>
<span id="en-ESV-4" class="text Gen-1-4">
<sup class="versenum">4 </sup>And God saw that the light was good. And God separated the light from the darkness.</span> <span id="en-ESV-5" class="text Gen-1-5"><sup class="versenum">5 </sup>God called the light Day, and the darkness he called Night. And there was evening and there was morning, the first day.
</span>
</p>
chapter-*
class의 p
tag 안에, text
class의 span
을 뽑아내야 하는군요.
이 사이트는 강적입니다! 아마도 crolling 하지 못하게 막은 듯 한데, 다음과 같은 error가 나네요.
C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/open-uri.rb:225:in `open_loop': redirection forbidden: http://www.biblegateway.com/passage/?search=luk1&version=NIV -> https://www.biblegateway.com/passage/?search=luk1&version=NIV (RuntimeError)
/cc @youngerous
URL is like this.
'translation_code' 는 소문자도 관계 없네요. 아래는 예제입니다.