selenium 스크롤 내리기
Python2022. 11. 17. 14:11
728x90
출처 : https://youtu.be/yQ20jZwDjTE?t=14429
interval = 2
prev_height = browser.execute_script('return document.body.scrollHeight')
while True:
browser.execute_script('window.scrollTo(0, document.body.scrollHeight)')
time.sleep(interval)
curr_height = browser.execute_script('return document.body.scrollHeight')
if curr_height == prev_height:
break
prev_height = curr_height
print('스크롤 완료')