In the crawler test. Found that including chrome, Safari, phantomjs are unable to traverse document.getElementsByTagName.The same situation can be under the Firefox 在做爬虫测试。发现包括chrome,Safari,phantomjs都无法遍历document.getElementsByTagName,同样的情况在firefox下是可以的
*** Bug 160380 has been marked as a duplicate of this bug. ***
hi!is bug?
Can you please provide a sample of JavaScript code that is failing on sec.sogou.com ? I am not clear on what the bug is yet.
> elements = document.getElementsByTagName("a") < HTMLCollection [<a>, <a>, <a>, <a>, <a>, <a>, <a id="login">, <a id="user">, <a>, <a>, …] (39) > elements.length < 39 > for (var i = 0; i < elements.length; i++) { console.log(elements[i]); } < undefined > elements[1] < <a href="/">首页</a> So it looks like console.log() is not working?
So the issue is not that we cannot traverse the HTMLCollection because: for (var i = 0; i < elements.length; i = i + 1) { alert(elements[i]); } displays 39 alert dialogs. However, if I use console.log(), I see nothing in WebInspector. This could be a WebInspector bug?
<rdar://problem/27625945>
Reproduction steps: 1. Go to http://sec.sogou.com 2. Open WebInspector 3. Type "console.log('test')" and press ENTER -> undefined, logs nothing. If you do the same thing on google.com, it works as expected.
No. This problem only occurs in sec.sogou.com I use the safari phantomjs chrome in this site test can not traverse through the console.log output, but in other sites can traverse and through the console.log output There's no problem in google.com.
(In reply to comment #8) > No. This problem only occurs in sec.sogou.com > I use the safari phantomjs chrome in this site test can not traverse through > the console.log output, but in other sites can traverse and through the > console.log output > There's no problem in google.com. Yes this is what I said...
Use console.debug or console.info to output. So this is not the browser in the processing of bug console.log?
Interestingly console.warn and console.error work correctly. Investigating.
Yeah, and the problem is only for sec.sogou.com, the other is not found
JavaScriptCore/runtime/ConsoleObject.cpp:73: // For legacy reasons, console properties are enumerable, writable, deleteable, // and all have a length of 0. This may change if Console is standardized. I wonder if the site is overwriting or deleting the `log` property. Every other console code path I tested works.
(In reply to comment #13) > JavaScriptCore/runtime/ConsoleObject.cpp:73: > > // For legacy reasons, console properties are enumerable, writable, > deleteable, > // and all have a length of 0. This may change if Console is standardized. > > I wonder if the site is overwriting or deleting the `log` property. Every > other console code path I tested works. Logging some console properties confirms this: > console.debug < function debug() { [native code] } > console.info < function info() { [native code] } > console.warn < function warn() { [native code] } > console.error < function error() { [native code] } > console.log < function () {}
The offending code is at the beginning of main.js: if (!window.debug) { console.log = function() {}; }
Thanks for looking Matt.
Sure thing!
Thank you,But have a bit puzzled in the Firefox browser, but can use the normal console.log