웹마짱구의 블로그

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('스크롤 완료')

728x90

http://codaa.tistory.com/371


상단에 아래코드 추가


# -*- coding: utf-8 -*-