自分用のまとめ
随時更新
自分がわかればいいからところどころ用語が間違ってるかも
!見方
#コマンド
#引数のオプションの説明
BeautifulSoupって何に使うの?
HTMLを解析してスクレイピングやら
モジュール読み込み
import bs4
頻出操作
HTMLインスタンス取得から頻出の解析
#解析用オブジェクト取得
soup = bs4.BeutifulSoup()
#第一引数にHTMLオブジェクト→webdriver.get_sourceとかで取れるやつ
#第二引数にHTMLパーサー
#→代表的なのlxml,html5lib,html.parser
#要素情報で一つ見つける
element = soup.find()
class= #クラス名
href= #リンク
"" #何もつけないとタブ
#要素情報ですべて見つける
element = soup.find_all()
#引数はfind()と同じ
#複数ある場合は返り値はリスト
#cssセレクタですべて見つける
element = soup.select()
#見つけた要素のテキスト部分だけにする
element.string