selenium.common.exceptions.WebDriverException: Message: unknown error: 'script' must be a string while using execute_script() through Selenium Python

后端 未结 3 1332
温柔的废话
温柔的废话 2021-01-25 14:41

I\'ve got an issue with browser.execute_script while using selenium with python. There is an element that i\'d like to click (it\'s xpath below)

\"//*[@id=\'lis         


        
3条回答
  •  不思量自难忘°
    2021-01-25 14:47

    Instead of

    browser.execute_script(navMenu.click())
    

    try

    browser.execute_script('arguments[0].click();', navMenu)
    

    or

    navMenu.click()
    

提交回复
热议问题