Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

closed #275 fix scraiping news #276

Merged
merged 6 commits into from
Aug 2, 2020

Conversation

korosuke613
Copy link
Member

@korosuke613 korosuke613 commented Aug 2, 2020

👏 解決する issue / Resolved Issues

📝 関連する issue / Related Issues

⛏ 変更内容 / Details of Changes

  • お知らせ情報のスクレイピングを新サイトに対応
  • ただし、更新日時の取得はできなくなったので、日付欄を削除
  • 検査実施人数に対応

📸 スクリーンショット / Screenshots

スクリーンショット 2020-08-02 14 48 33

@korosuke613 korosuke613 added the bug Something isn't working label Aug 2, 2020
@korosuke613 korosuke613 changed the title Ticket 275 fix scraiping news closed #275 fix scraiping news Aug 2, 2020
@korosuke613 korosuke613 force-pushed the ticket-275-fix-scraiping-news branch from f7854ad to 8949ab5 Compare August 2, 2020 05:57
Copy link
Member

@TakaShinoda TakaShinoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@Morichan Morichan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントしました
大枠としては問題無さそうです

.ruby-version Show resolved Hide resolved
data/data.json Outdated Show resolved Hide resolved
data/data.json Outdated Show resolved Hide resolved
scrapingSource/scraping.rb Outdated Show resolved Hide resolved
scrapingSource/scraping.rb Outdated Show resolved Hide resolved
total = rows.find_element(:tag_name => "td").find_element(:tag_name => "p")

data_hash = {}
File.open("data/data.json") do |file|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruby をよく知らないので質問なのですが、ファイルオープン例外が発生する場合の実装は、必要ないのでしょうか?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

調べてみたのですが、正直よくわかりませんでした。
大丈夫そう

data_hash["main_summary"]["value"] = total.text.delete(",").to_i

data_json = JSON.pretty_generate(data_hash, {:indent => " "})
File.open("data/data.json", mode = "w") { |f|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こちらも、例外時の実装は必要無いのでしょうか?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

調べてみたのですが、正直よくわかりませんでした。
大丈夫そう

@korosuke613 korosuke613 force-pushed the ticket-275-fix-scraiping-news branch from c202128 to 6f9fbd7 Compare August 2, 2020 08:35
@Morichan
Copy link

Morichan commented Aug 2, 2020

もう1つの方を見て気づいたのですが、スネークケースとキャメルケースが混ざってます。
結構入り組んでいて修正は大変そうですが、どうしますか?

@korosuke613
Copy link
Member Author

もう1つの方を見て気づいたのですが、スネークケースとキャメルケースが混ざってます。
結構入り組んでいて修正は大変そうですが、どうしますか?

直します

@korosuke613
Copy link
Member Author

@Morichan キャメルケースに統一しました

@korosuke613 korosuke613 requested a review from Morichan August 2, 2020 09:08
Copy link

@Morichan Morichan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@korosuke613 korosuke613 merged commit d903f49 into development Aug 2, 2020
@korosuke613 korosuke613 mentioned this pull request Aug 2, 2020
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants