scpscraper
v1.0.1)
SCP Wikiからデータを削減するために設計された小さなPythonライブラリ。 AIトレーニング(すなわち、NLPモデル)とデータセットコレクション(外部プロジェクトのSCPの分類など)を念頭に置いて作成されており、これらのアプリケーションでの使いやすさを可能にする議論があります。
以下に、インストール手順、このライブラリの使用方法の例、およびそれを利用できる方法を示します。これが私と同じように便利だと思うことを願っています!
scpscraper pip installを介してインストールできます。使用するコマンドは次のとおりです。そのため、一貫して最新バージョンがあります。
pip3 install --upgrade scpscraper
# Before we begin, we obviously have to import scpscraper.
import scpscraper # Let's use 3001 (Red Reality) as an example.
name = scpscraper . get_scp_name ( 3001 )
print ( name ) # Outputs "Red Reality" # Again using 3001 as an example
info = scpscraper . get_scp ( 3001 )
print ( info ) # Outputs a dictionary with the
# name, object id, rating, page content by section, etc.page-content DIV HTMLを取得します参照のために、 page-content Divには、追加のWikidot外部のものがなく、ユーザーが実際に書いたものが含まれています。
# Once again, 3001 is the example
scp = scpscraper . get_single_scp ( 3001 )
# Grab the page-content div specifically
content = scp . find_all ( 'div' , id = 'page-content' )
print ( content ) # Outputs "<div id="page-content"> ... </div>" # Grab info on SCPs 000-099
scpscraper . scrape_scps ( 0 , 100 )
# Same as above, but only grabbing Keter-class SCPs
scpscraper . scrape_scps ( 0 , 100 , tags = [ 'keter' ])
# Grab 000-099 in a format that can be used to train AI
scpscraper . scrape_scps ( 0 , 100 , ai_dataset = True ) # Scrape the page-content div's HTML from SCP-000 to SCP-099
# Only including this as an example, but scrape_scps_html() has
# all the same options as scrape_scps().
scpscraper . scrape_scps_html ( 0 , 100 )google.colabモジュールがGoogle Colaboratoryに含まれているため、他の方法ではできないことをいくつか追加することができます。
# Mounts it to the directory /content/drive/
scpscraper . gdrive . mount () # Requires your Google Drive to be mounted at the directory /content/drive/
scpscraper . scrape_scps ( 0 , 100 , copy_to_drive = True )
scpscraper . scrape_scps_html ( 0 , 100 , copy_to_drive = True ) # Requires your Google Drive to be mounted at the directory /content/drive/
scpscraper . gdrive . copy_to_drive ( 'example.txt' )
scpscraper . gdrive . copy_from_drive ( 'example.txt' )将来の潜在的な更新は、あらゆるウェブサイトからのスクレイプデータを簡単/実行可能にし、データの容易なマス収集を可能にします。
チェックアウトしてください! GitHub Repoで、問題、リクエスト機能、このプロジェクトに貢献するなどを報告できます。これが、このプロジェクトに関連する問題/フィードバックに私に連絡するための最良の方法です。
https://github.com/jaonhax/scpscraper/