From 2615ae34f7b1e73b326c5969d6e1e245c354ef80 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2019 11:12:52 +0800 Subject: [PATCH] 1 --- scripts/cdb/cdb.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/scripts/cdb/cdb.py b/scripts/cdb/cdb.py index 770c6c7..59a756b 100644 --- a/scripts/cdb/cdb.py +++ b/scripts/cdb/cdb.py @@ -5,20 +5,23 @@ import scriptmgr #os.environ['DEBUG'] = '1' +def initTab(tab): + tab.call_method("Network.enable", maxPostDataSize=65536) + tab.call_method("Page.enable") + tab.call_method("Page.getResourceTree") + tab.call_method("Profiler.enable") + tab.call_method("Runtime.enable") + tab.call_method("Debugger.enable", maxScriptsCacheSzie=1000000) + tab.call_method("DOM.enable") + tab.call_method("CSS.enable") + tab.call_method("Overlay.enable") + tab.call_method("Log.enable") + browser = pychrome.Browser(url="http://192.168.100.137:9223") tab = browser.new_tab() scriptmgr = scriptmgr.ScriptMgr(tab) +initTab(tab) tab.start() -tab.call_method("Network.enable", maxPostDataSize=65536) -tab.call_method("Page.enable") -tab.call_method("Page.getResourceTree") -tab.call_method("Profiler.enable") -tab.call_method("Runtime.enable") -tab.call_method("Debugger.enable", maxScriptsCacheSzie=1000000) -tab.call_method("DOM.enable") -tab.call_method("CSS.enable") -tab.call_method("Overlay.enable") -tab.call_method("Log.enable") tab.call_method("Page.navigate", url="http://localhost:7456/", _timeout=5) while True: