Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
In Chrome:
File "...\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 635, in execute_script 'args': converted_args})['value']
File "...\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "...\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Cannot read pro'scrollIntoView' of null
In Firefox:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: arguments[0] is null
Browser info: chrome=68.0.3440.106
Driver info: chromedriver=2.41.578737
Platform=Windows NT 6.1.7601 SP1 x86_64
–
This error message...
selenium.common.exceptions.JavascriptException: Message: TypeError: arguments[0] is null
...implies that the WebElement referred as arguments[0] is null i.e. doesn't contain any reference.
Your main issue is the WebElement you are referring as final_side doesn't contain any reference to any element within the webpage.
Without the previous commands and relevant HTML it is tough to guess the exact reason of the error.
Solution
A possible solution would be to induce WebDriverWait for the desired element to be visible within the HTML DOM as follows:
element = WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "element_css")))
self.driver.execute_script("return arguments[0].scrollIntoView(true);", element)
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.