While implementing scraping of a web page with infinite scrolling in Python, I stumbled because I didn't know how to finish it.
>>> t = 0
>>> start_at = time.time()
>>> t = time.time() - start_at
>>> t == 5
>>> break
start_at
is the time that has elapsed since it was executed.
t
is the difference
When t
reaches 5 (5 seconds have passed), the process ends.
reference https://note.nkmk.me/python-datetime-timedelta-measure-time/ https://ai-inter1.com/python-selenium/#st-toc-h-14
Recommended Posts