Diggernaut

El Paso County Sheriff's Office Blotter

Oct 29th, 2016
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.28 KB | None | 0 0
  1. # Digger configuration for Diggernaut.com service
  2. # written using Excavator app
  3. # Explanation article: https://blog.diggernaut.com/extracting-data-from-el-paso-county-sheriff-blotter/
  4. do:
  5.   - link_add: 'http://www.epcsheriffsoffice.com/blotter'
  6.   - walk:
  7.       to: links
  8.       do:
  9.         - find:
  10.             path: 'tbody > tr'
  11.             do:
  12.               - object_new: incident
  13.               - find:
  14.                   path: ' td:nth-child(1)'
  15.                   do:
  16.                    - parse
  17.                     - object_field_set:
  18.                         object: incident
  19.                         field: call_number
  20.               - find:
  21.                   path: ' td:nth-child(2) > .date-display-single:nth-child(1)'
  22.                   do:
  23.                    - parse
  24.                     - object_field_set:
  25.                         object: incident
  26.                         field: date
  27.               - find:
  28.                   path: div .date-display-single
  29.                   do:
  30.                    - parse
  31.                     - object_field_set:
  32.                         object: incident
  33.                         field: time
  34.               - find:
  35.                   path: ' td:nth-child(3)'
  36.                   do:
  37.                    - parse
  38.                     - object_field_set:
  39.                         object: incident
  40.                         field: address
  41.               - find:
  42.                   path: ' td:nth-child(4)'
  43.                   do:
  44.                    - parse
  45.                     - object_field_set:
  46.                         object: incident
  47.                         field: grid
  48.               - find:
  49.                   path: ' td:nth-child(5)'
  50.                   do:
  51.                    - parse
  52.                     - object_field_set:
  53.                         object: incident
  54.                         field: problem
  55.               - find:
  56.                   path: ' td:nth-child(6)'
  57.                   do:
  58.                    - parse
  59.                     - object_field_set:
  60.                         object: incident
  61.                         field: disposition
  62.               - object_save:
  63.                   name: incident
  64.         - find:
  65.             path: .pager-next a
  66.             do:
  67.               - parse:
  68.                   attr: href
  69.               - link_add
Add Comment
Please, Sign In to add comment