for i in range(200):
driver.execute_script("var evt = document.createEvent('MouseEvents');evt.initEvent('wheel', true, true);evt.deltaY = -100000;document.querySelector('.yamb-conversation__content').dispatchEvent(evt);")
html2 = driver.page_source
soup2 = BeautifulSoup(html2, 'lxml')
driver.execute_script("var evt = document.createEvent('MouseEvents');evt.initEvent('wheel', true, true);evt.deltaY = -100000;document.querySelector('.yamb-conversation__content').dispatchEvent(evt);scroll-behavior: smooth;")
var evt = document.createEvent('MouseEvents');
evt.initEvent('wheel', true, true);
evt.deltaY = -100000;
document.querySelector('.yamb-conversation__content').dispatchEvent(evt);
driver.execute_script('var evt = document.createEvent("MouseEvents"); '
'evt.initEvent("wheel", true, true);'
'evt.deltaY = -100000;'
'document.querySelector(".yamb-conversation__content").dispatchEvent(evt);)')
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/project/parser_2.py", line 20, in <module>
driver.execute_script('var evt = document.createEvent("MouseEvents"); '
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 634, in execute_script
return self.execute(command, {
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: javascript error: Unexpected token ')'
(Session info: chrome=83.0.4103.61)
driver.execute_script('var evt = document.createEvent("MouseEvents");'
'evt.initEvent("wheel", true, true);'
'evt.deltaY = -100000;'
"document.querySelector('.yamb-conversation__content').dispatchEvent(evt);'")
selenium.common.exceptions.JavascriptException: Message: javascript error: Invalid or unexpected token