I'm receiving the following error when launching my python script with selenium.
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: javascript error: arguments[0].scrollTo is not a function
I'm not sure what exactly is going on here - I would give more detail, but here is the program I'm running where this error is coming from.
def scroll_slow(self, scrollable_element, start=0, end=3600, step=100, reverse=False):
if reverse:
start, end = end, start
step = -step
for i in range(start, end, step):
self.browser.execute_script("arguments[0].scrollTo(0, {})".format(i), scrollable_element)
time.sleep(random.uniform(1.0, 2.6))
If you see anything out of place, please help.
I've tried commenting this section out - but it messes up the whole script.