I have the problem of running this. I get back an error stating that I have a syntax issue. Ineed help with the Syntax.driver.execute_script("$('select[name='condition'] option:eq(30)').prop('selected', true);") 解决方案 So if jquery is not on the page you need to add it first. I am just appending it to the page below. Then run your code.driver.execute_script("""var script = document.createElement( 'script' );script.type = 'text/javascript';script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js';document.head.appendChild(script);""")driver.execute_script("$('select[name='condition'] option:eq(30)').prop('selected', true);")More jquery links can be found at: https://code.jquery.com/ 这篇关于在硒Python中执行jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!