Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- config:
- debug: 2
- agent: "Firefox"
- do:
- - walk:
- to: 'http://www.illinoisschools.com/schools/public.aspx'
- do:
- - find:
- path: 'a.linkSmallclean'
- do:
- - parse:
- attr: href
- - walk:
- to: value
- do:
- - find:
- path: div#AllSchoolData
- do:
- - find:
- path: tr>td:nth-of-type(2)>b>a
- do:
- - parse:
- attr: href
- - walk:
- to: value
- do:
- - find:
- path: td[valign="top"]:has(a:contains('Get Directions'))
- do:
- - split:
- context: html
- delimiter: '<br/>'
- - object_new: school
- - find:
- path: div.element_0
- do:
- - parse
- - object_field_set:
- object: school
- field: name
- - find:
- path: div.element_1
- do:
- - parse
- - object_field_set:
- object: school
- field: street
- - find:
- path: div.element_2
- do:
- - parse:
- filter: \s*([^,]+),
- - object_field_set:
- object: school
- field: city
- - register_set: IL
- - object_field_set:
- object: school
- field: state
- - find:
- path: div.element_2
- do:
- - parse:
- filter: (\d+)
- - object_field_set:
- object: school
- field: zip
- - find:
- path: div.element_4
- do:
- - parse:
- filter: '(.+)\s+County,\s+Illinois'
- - object_field_set:
- object: school
- field: county
- - find:
- path: div.element_5
- do:
- - parse
- - object_field_set:
- object: school
- field: phone
- - object_save:
- name: school
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement