LoginSignup
0
1

More than 3 years have passed since last update.

Pythonの無限スクロールスクレイピングの終わらせ方

Last updated at Posted at 2020-07-31

Pythonで無限スクロールがあるWebページのスクレイピングを実装中、終わらせ方がわからなくてつまづいたのでメモ

サンプル

>>> t = 0
>>> start_at = time.time()
>>> t = time.time() - start_at
>>> t == 5
>>> break

解説

start_atは、実行してから経過している時間
tは、その差
tが5(5秒経過)になると、処理を終了する

参考
https://note.nkmk.me/python-datetime-timedelta-measure-time/
https://ai-inter1.com/python-selenium/#st-toc-h-14

0
1
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
1