mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-05-02 14:46:18 -04:00
avoid "Uncaught TypeError: Cannot read property 'querySelectorAll' of undefined" from outlinks script
This commit is contained in:
parent
ed7e01210d
commit
1c5c9417d2
2 changed files with 8 additions and 6 deletions
|
@ -304,11 +304,13 @@ class Browser:
|
||||||
var __brzl_framesDone = new Set();
|
var __brzl_framesDone = new Set();
|
||||||
var __brzl_compileOutlinks = function(frame) {
|
var __brzl_compileOutlinks = function(frame) {
|
||||||
__brzl_framesDone.add(frame);
|
__brzl_framesDone.add(frame);
|
||||||
var outlinks = Array.prototype.slice.call(
|
if (frame && frame.document) {
|
||||||
frame.document.querySelectorAll('a[href]'));
|
var outlinks = Array.prototype.slice.call(
|
||||||
for (var i = 0; i < frame.frames.length; i++) {
|
frame.document.querySelectorAll('a[href]'));
|
||||||
if (frame.frames[i] && !__brzl_framesDone.has(frame.frames[i])) {
|
for (var i = 0; i < frame.frames.length; i++) {
|
||||||
outlinks = outlinks.concat(__brzl_compileOutlinks(frame.frames[i]));
|
if (frame.frames[i] && !__brzl_framesDone.has(frame.frames[i])) {
|
||||||
|
outlinks = outlinks.concat(__brzl_compileOutlinks(frame.frames[i]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return outlinks;
|
return outlinks;
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -32,7 +32,7 @@ def find_package_data(package):
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='brozzler',
|
name='brozzler',
|
||||||
version='1.1b6.dev77',
|
version='1.1b6.dev78',
|
||||||
description='Distributed web crawling with browsers',
|
description='Distributed web crawling with browsers',
|
||||||
url='https://github.com/internetarchive/brozzler',
|
url='https://github.com/internetarchive/brozzler',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue