How to open chrome developer console using Selenium in Python? -
i trying open developer console in chrome using selenium webdriver. doing
from selenium import webdriver
from selenium.webdriver.common import action_chains, keys
...
browser = webdriver.chrome(executable_path="c:\chrm\chromedriver.exe") browser.get("https://www.facebook.com/groups/gnexus5/")
...
action = action_chains.actionchains(browser)
action.send_keys(keys.keys.control+keys.keys.shift+'j')
action.perform()
but not opening developer console. have tried other keys (just typing key-strokes, control-selecting element) , working.
i using chromedriver
only if in desperate , os windows, can adding autohotkey script python code. can download autohk here
install autohk. create new script in notepad: put 1 short string
send ^+j
and save script.ahk. these actions takes 2-3 minutes. call in code
browser.get("https://www.facebook.com/groups/gnexus5/") import os os.system("path_to_script.ahk/script.ahk") and gonna work :)
Comments
Post a Comment