This repository was archived by the owner on May 9, 2023. It is now read-only.
WIP:beatifulsoupを使用して新しい構造のスクレイピングを行う #1548
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
念のためWIPにしておきます。サイト運用側で新しい構造になったこと確認してから採用にしてください
👏 解決する issue / Resolved Issues
📝 関連する issue / Related Issues
⛏ 変更内容 / Details of Changes
📸 スクリーンショット / Screenshots
現在のサイトのDOMツリー
上記をBeatifulSoupでスクレイピングした結果
{ "newsItems": [ { "date": "2022/08/07", "url": "https://www.city.hamamatsu.shizuoka.jp/koho2/emergency/20220807_2.html", "text": "新型コロナウイルス感染症による患者確認について(8月7日公表)" }, { "date": "2022/08/07", "url": "", "text": "新型コロナウイルスに関するPCR検査実施状況(8月6日現在) 令和2年2月14日~令和4年8月6日 34,563件" }, { "date": "2022/08/06", "url": "https://www.city.hamamatsu.shizuoka.jp/koho2/emergency/20220806_2.html", "text": "新型コロナウイルス感染症による患者確認について(8月6日公表)" }, { "date": "2022/08/05", "url": "https://www.city.hamamatsu.shizuoka.jp/koho2/emergency/20220805_2.html", "text": "新型コロナウイルス感染症による患者確認について(8月5日公表)" }, { "date": "2022/08/05", "url": "https://www.city.hamamatsu.shizuoka.jp/koho2/emergency/20220805_3.html", "text": "新型コロナウイルス感染症(変異株)による患者確認について(8月5日公表)" }, { "date": "2022/08/05", "url": "https://www.city.hamamatsu.shizuoka.jp/koho2/emergency/covid-19/index.html", "text": "新型コロナウイルス感染症患者動向" } ] }プレビューサイトのスクショ