Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

リンクの抽出がバグっている #130

Open
PharaohKJ opened this issue Sep 3, 2016 · 1 comment
Open

リンクの抽出がバグっている #130

PharaohKJ opened this issue Sep 3, 2016 · 1 comment

Comments

@PharaohKJ
Copy link
Member

閉じ括弧が含まれてしまうようだ

石川県休日当番医情報を(http://i-search.pref.ishikawa.jp/toban/index.php?a=3) スクレイピングサービスkimonolabを使ってAPI化していましたが、kimonolab終了に伴いサービスが停止しております。

だと、URL が http://i-search.pref.ishikawa.jp/toban/index.php?a=3) となってしまう。

@PharaohKJ
Copy link
Member Author

PharaohKJ commented Sep 4, 2016

Rubyの標準ライブラリを使ってます

irb(main):008:0> URI.extract('(http://a.b.c/index)')
=> ["http://a.b.c/index)"]

この動きは、RFC的に正しいです

http://freak-da.hatenablog.com/entry/20080321/p1

RFCの定義では ) はURI としてありえるとあります。

真面目に対応することを考えると抽出時に抽出したURLが404か確認し、404の場合は
予想してあれこれする、という対応になりそうですが、手間かかるのでいったんこのままで

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant