I'm trying to use a javascript code I found online in my Chrome browser console so that I can automatically scroll down on a instagram webpage to the very bottom of the page. This is the code that I have been running - see attached.
However, it seems that I cannot make it stop scrolling to the bottom of the webpage after it has reached a desire point that I want it to stop. I tried running the second code shown in the screenshot but it does not seem to work either.
Someone to help me figure out how to stop running the javascript after a certain point that I want to stop.