-> loadEntries = self.webdriver.execute_script("return window.performance.getEntries()")
(Pdb)
selenium.common.exceptions.JavascriptException: Message: Cyclic object value

JSON.stringify报cyclic object value错误,这是一个典型的循环引用的错误,一个对象里引用自己就会立刻得到这个错误:

1 obj = { x:555, y: "hi" };
2 obj.myself = obj;
4 try{
5     json = JSON.stringify(obj);
6     alert(json)
7 }catch(e){
8     alert(e);
View Code

loadEntries = self.webdriver.execute_script("var result=[];window.performance.getEntries().forEach(function (perf){result.push({'responseEnd':perf.responseEnd})});return result")