我们有时差,将采取输入,例如BOT:是否有从不提供API的网站抓取文本的替代方法?
bible John 3:17 (ESV)
这将变成一个电话
https://www.biblegateway.com/passage/?search=John+3:17&version=ESV
所以,我们已经完蛋了,现在是我们会得到:
curl 'https://www.biblegateway.com/passage/?search=John+3:17&version=ESV' | grep "og:description" | sed 's/.*content="//' | sed 's/".*//'
For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him.
这适用于小请求,例如bible John 3:1-4
- 但是,如果我们请求较大的部分,说明字段会在某个点被截断。因此,如果我们要做bible John 3
,它只会返回约翰1的前5个左右的经文。
除了上面的卷曲之外,还有更好的方法可以去解决吗?在包含全文响应的唯一其他地方是原始的HTML,e.g,:
<h1 class="passage-display"> <span class="passage-display-bcv">John 3</span><span class="passage-display-version">English Standard Version (ESV)</span></h1> [ ... etc. etc. ... ]
我们是否应该寻找的不仅仅是HTTP这个请求其他的东西吗?
网站与任何你喜欢的语言,也许Java和JSoup或Python的东西... – Marged