Javascript 尝试执行驱动程序时没有回答。执行_脚本(gooogletag
当我使用Selenium运行googletag参数时,我试图从浏览器的控制台中获得一些响应,但不幸的是,我没有 我已经尝试了Javascript 尝试执行驱动程序时没有回答。执行_脚本(gooogletag,javascript,python-3.x,selenium,Javascript,Python 3.x,Selenium,当我使用Selenium运行googletag参数时,我试图从浏览器的控制台中获得一些响应,但不幸的是,我没有 我已经尝试了.execute\u async\u script('googletag.pubads()')以及将所有内容放入try/execute中,但即使我没有得到任何回复,也不会调用execute 这是我的代码: from selenium import webdriver from selenium.webdriver.common.desired_capabilities im
.execute\u async\u script('googletag.pubads()')
以及将所有内容放入try/execute中,但即使我没有得到任何回复,也不会调用execute
这是我的代码:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
url = 'https://joursferies.fr'
d = DesiredCapabilities.CHROME
d['loggingPrefs'] = { 'browser':'ALL' }
browser = webdriver.Chrome(desired_capabilities=d)
browser.get(url)
browser.execute_script('googletag.openConsole()')
# Until here everything is perfect but with the following line is when I never get any answer:
browser.execute_script('googletag.pubads()')
我希望浏览器Inspect中的控制台会向我显示信息,但它不会显示任何内容。尝试添加return,
Browser.execute\u脚本('return googletag.openConsole()')
尝试添加return,Browser.execute\u脚本('return googletag.openConsole()'))
@error404如果此答案有助于您投票或为了未来读者的利益接受答案。请参阅:@error404如果此答案有助于您投票或为了未来读者的利益接受答案。请参阅: