0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

スクレイピング クローラー開発のヒント【ページネーションのスクレイピング】

Posted at

ページネーション部分をスクレイピングするためのTipsをシェアします!
以下のプログラムを参考に、実装してみてくださいね

ページ番号リンクをすべて見つける

page_links = soup.find_all('a', class_='Pager_link__rnYFP')

ページ番号を抽出して整数に変換

page_numbers = [int(link.text) for link in page_links if link.text.isdigit()]

最大のページ番号を見つける

max_page_number = max(page_numbers)

print("最大のページ番号は:", max_page_number)

以上です。
何か少しでもあなたのお役に立てば幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?