Package: brozzler
brozzler“browser” | “crawler” = “brozzler”Brozzler is a distributed web crawler (爬虫) that uses a real browser (Chrome
or Chromium) to fetch pages and embedded URLs and to extract links. It employsyoutube-dlto enhance media capture
capabilities andrethinkdbto
manage crawl state.Brozzler is designed to work in conjuction with warcprox for web archiving.RequirementsPython 3.5 or laterRethinkDB deploymentChromium or Google Chrome >= version 64Note: The browser requires a graphical environment to run. When brozzler is run
on a server, this may require deploying some additional infrastructure,
typically X11. Xvnc4 and Xvfb are X11 variants that are suitable for use on a
server, because they don’t display anything to a physical screen. Thevagrant
configurationin the brozzler repository has an example setup
using Xvnc4. (When last tested, chromium on Xvfb did not support screenshots,
so Xvnc4 is preferred at this time.)Getting StartedThe easiest way to get started with brozzler for web archiving is withbrozzler-easy. Brozzler-easy runs brozzler-worker, warcprox, brozzler
wayback, and brozzler-dashboard, configured to work with each other in a single
process.Mac instructions:# install and start rethinkdb
brew install rethinkdb
# no brew? try rethinkdb's installer: https://www.rethinkdb.com/docs/install/osx/
rethinkdb &>>rethinkdb.log &

# install brozzler with special dependencies pywb and warcprox
pip install brozzler[easy]  # in a virtualenv if desired

# queue a site to crawl
brozzler-new-site http://example.com/

# or a job
brozzler-new-job job1.yml

# start brozzler-easy
brozzler-easyAt this point brozzler-easy will start archiving your site. Results will be
immediately available for playback in pywb athttp://localhost:8880/brozzler/.Brozzler-easy demonstrates the full brozzler archival crawling workflow, but
does not take advantage of brozzler’s distributed nature.Installation and UsageTo install brozzler only:pip install brozzler  # in a virtualenv if desiredLaunch one or more workers:[*]brozzler-worker --warcprox-autoSubmit jobs:brozzler-new-job myjob.yamlSubmit sites not tied to a job:brozzler-new-site --time-limit=600 http://example.com/[*]A note about--warcprox-auto: this option tells brozzler to
look for a healthy warcprox instance in therethinkdb service registry. For
this to work you need to have at least one instance of warcprox running,
with the--rethinkdb-services-urloption pointing to the same rethinkdb
services table that brozzler is using. Using--warcprox-autois
recommended for clustered deployments.Job ConfigurationBrozzler jobs are defined using YAML files. Options may be specified either at
the top-level or on individual seeds. At least one seed URL must be specified,
however everything else is optional. For details, seejob-conf.rst.id: myjob
time_limit: 60 # seconds
proxy: 127.0.0.1:8000 # point at warcprox for archiving
ignore_robots: false
warcprox_meta: null
metadata: {}
seeds:
  - url: http://one.example.org/
  - url: http://two.example.org/
    time_limit: 30
  - url: http://three.example.org/
    time_limit: 10
    ignore_robots: true
    scope:
      surt: http://(org,example,Brozzler DashboardBrozzler comes with a rudimentary web application for viewing crawl job status.
To install the brozzler with dependencies required to run this app, runpip install brozzler[dashboard]To start the app, runbrozzler-dashboardAt this point Brozzler Dashboard will be accessible athttp://localhost:8000/.Seebrozzler-dashboard--helpfor configuration options.Brozzler WaybackBrozzler comes with a customized version ofpywb, which supports using the rethinkdb
“captures” table (populated by warcprox) as its index.To use, first install dependencies.pip install brozzler[easy]Write a configuration file pywb.yml.# 'archive_paths' should point to the output directory of warcprox
archive_paths: warcs/  # pywb will fail without a trailing slash
collections:
  brozzler:
    index_paths: !!python/object:brozzler.pywb.RethinkCDXSource
      db: brozzler
      table: captures
      servers:
      - localhost
enable_auto_colls: false
enable_cdx_api: true
framed_replay: true
port: 8880Run pywb like so:$ PYWB_CONFIG_FILE=pywb.yml brozzler-waybackThen browsehttp://localhost:8880/brozzler/.Headless Chrome (experimental)Brozzler is known to work nominally with Chrome/Chromium in headless mode, but
this has not yet been extensively tested.LicenseCopyright 2015-2018 Internet ArchiveLicensed under the Apache License, Version 2.0 (the “License”); you may
not use this software except in compliance with the License. You may
obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.