相关文章推荐
强健的烤面包  ·  Apache ...·  1 年前    · 
冲动的木耳  ·  NameError: name ...·  1 年前    · 
朝气蓬勃的饼干  ·  smtp relay server ...·  1 年前    · 

-> 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")