planningalerts-scrapers / townsville

Townsville City Council Development Applications


Townsville City Council scraper

This is a scraper that runs on Morph. To get started see the documentation.

It scrapes development applications for Townsville City Council from the council's ePlanning site and feeds PlanningAlerts.

Issues with this authority are tracked in the shared issue tracker: planningalerts-scrapers/issues#1460.

How the site is structured

  • The ePlanning site (XC.Track) lists every application lodged in a period (thisweek, lastweek, thismonth or lastmonth) on one page. The results are all in the page and paged in the browser with JavaScript. It covers development, building and plumbing applications, including referral agency responses (CAR) and changes to approvals.
  • Each application is a div.result with the reference linking to its details page, the description, one or more addresses and a hidden "More" section with the lodged date and status. The scraper uses the first address.
  • The page says how many applications it found. The scraper raises an error if the number of results doesn't match.
  • A period with no applications, such as a quiet 1st of the month, is normal. The scraper prints No applications lodged <period> and carries on, even if the page gives no count. PlanningAlerts flags long gaps in new applications itself.
  • Applications on public notification have their own list in the same format. Their notification start and end dates are read from each one's details page.
  • The site's XML output (o=xml), used by the multiple_icon scraper, returns an error page, so this scraper reads the HTML. If another XC.Track council needs its HTML scraped too, this could become a multiple_* scraper.

Running

bundle install bundle exec ruby scraper.rb

To run the tests and style checks:

bundle exec rake bundle exec rubocop

The tests use saved copies of the site's pages in spec/fixtures/, cut down to one result per case, with made-up references and addresses. They don't contact the council's site. A coverage summary is printed at the end, and the full report is written to coverage/index.html.

Environment variables:

  • MORPH_AUSTRALIAN_PROXY - optional; when set (e.g. http://morph:password@au.proxy.oaf.org.au:8888) all requests go through the Australian proxy.
  • MORPH_PERIOD - optional; one of thisweek, lastweek, thismonth or lastmonth. By default both thismonth and lastmonth are scraped. Applications on public notification are always scraped.
  • MORPH_DEBUG - optional; when set, prints each record as it is saved.

Expected output is a heading for each list, a Storing <reference> - <address> line for each application, a count per list and a final total, for example:

``` Running ruby 3.2.2

Scraping applications lodged thismonth... Storing CAR26/0574 - 40 Daintree Drive BUSHLAND BEACH QLD 4818 Storing CAR26/0575 - 21 Ranana Place MOUNT LOW QLD 4818 ... Storing POS26/0141 - 112 Gollogly Lane RASMUSSEN QLD 4815 Storing OPW25/0032.10 - 155 Lynam Road GUMLOW QLD 4815 Finished thismonth - processed 72 records

Scraping applications lodged lastmonth... Storing CAR26/0508 - 6 Coleman Street HYDE PARK QLD 4812 Storing CAR26/0511 - 23 Crauford Street WEST END QLD 4810 ... Storing POS26/0128 - 16 Clayton Street HERMIT PARK QLD 4812 Storing RAL26/0108 - 10 Willeroo Court ANNANDALE QLD 4814 Finished lastmonth - processed 139 records

Scraping applications on public notification... Storing MCU26/0034 - 128 Manton Quarry Road CALCIUM QLD 4816 Storing MCU26/0051 - 18 Hinchinbrook Drive THURINGOWA CENTRAL QLD 4817 ... Storing MCU26/0093 - 76 Gerard Street CURRAJONG QLD 4812 Storing MCU26/0112 - 11 Springfield Street YABULU QLD 4818 Finished on notification - processed 5 records

Finished - saved 213 records ```

A run takes under a minute (20 to 35 seconds on 31 October 2026).

An application with no application number or address is skipped with a Skipping bad application line, and the total then also says how many were skipped. Other gaps don't skip it. With no description it is described as "Development Application". With no details link it links to the search page. With an unreadable lodged or notification date, that date is left out and a warning is printed. The run stops with an error once more than 10 + 20% of the saved count have been skipped.

An application on public notification is often also in the lodged lists. Records are saved by council_reference, so the second save updates the same record and adds the notification dates. The final total counts each record once, so it can be less than the sum of the per-list counts (213 rather than 216 above). The total is usually a couple of hundred. The records are saved to data.sqlite in the working directory.

Contributors mlandauer daveslutzkin henare hailspuds otherchirps LoveMyData jamezpolley ianheggie-oaf benrfairless

Last run failed with status code 1.

Console output of last run

Injecting configuration and compiling... Injecting scraper and running... Running ruby 3.2.2 Scraping applications lodged thismonth... /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/net/protocol.rb:46:in `connect_nonblock': SSL_connect returned=1 errno=0 peeraddr=203.24.71.56:443 state=error: certificate verify failed (unable to get local issuer certificate) (OpenSSL::SSL::SSLError) from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/net/protocol.rb:46:in `ssl_socket_connect' from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/net/http.rb:1342:in `connect' from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/net/http.rb:1248:in `do_start' from /app/vendor/ruby-3.2.2/lib/ruby/3.2.0/net/http.rb:1243:in `start' from /app/vendor/bundle/ruby/3.2.0/gems/net-http-persistent-4.0.8/lib/net/http/persistent.rb:722:in `start' from /app/vendor/bundle/ruby/3.2.0/gems/net-http-persistent-4.0.8/lib/net/http/persistent.rb:650:in `connection_for' from /app/vendor/bundle/ruby/3.2.0/gems/net-http-persistent-4.0.8/lib/net/http/persistent.rb:952:in `request' from /app/vendor/bundle/ruby/3.2.0/gems/mechanize-2.14.1/lib/mechanize/http/agent.rb:308:in `fetch' from /app/vendor/bundle/ruby/3.2.0/gems/mechanize-2.14.1/lib/mechanize.rb:483:in `get' from scraper.rb:116:in `get' from scraper.rb:89:in `scrape_lodged' from scraper.rb:68:in `block in run' from scraper.rb:68:in `each' from scraper.rb:68:in `run' from scraper.rb:47:in `run' from scraper.rb:226:in `<main>'

Data

Downloaded 14402 times by slav123 openaustralia dcalde mlandauer LoveMyData jesse-a-reilly DevAppProject tkrikke Manasaanand kiwicryptomoon-dot repose-lecture cjrh90 TheZepto AthleticoPrawn WilliamYun Joel-Tan_valocity dandanaus qs4v8thvrq-boop 538digital tcassell94 henare odnagroup peteclowes Jedwards157 TRAVISSTR michaeltaylorgit planometric-vic MikeRalphson newmana

To download data sign in with GitHub

Download table (as CSV) Download SQLite database (2.94 MB) Use the API

rows 10 / 7104

date_scraped description info_url date_received council_reference address comment_url on_notice_from on_notice_to
2011-09-11
Request to Extend the Relevant Period associated with R279.2572
2011-09-09
RC11/0015.02
82 Dunlop Street KELSO QLD 4815
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Request Approval to Allow Construction in 2 Stages associated with R279.2572
2011-09-02
RC11/0015.01
82 Dunlop Street KELSO QLD 4815
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Detached House - Steep slopes Overlay and height Variation
2011-09-01
MC11/0071
29 Braemar Crescent CASTLE HILL QLD 4810
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Detached House (Lot 1 RP 745347 Lease LZ No. 9)
2011-09-01
MI11/0049
7 - 9 Rae Crescent (Private) Cleveland Palms NOME QLD 4816
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Detached House - Steep Lands Overlay
2011-08-30
MC11/0069
348 Stanley Street NORTH WARD QLD 4810
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Side Retaining Wall
2011-09-02
OP11/0098
12 Clifton Street NORTH WARD QLD 4810
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Congregational Mixed-Use Facility ancillary to existing Educational Establishment and demolition of Four (4) site buildings including a building listed on the Local Heritage Database
2011-08-30
MC11/0070
45 The Strand NORTH WARD QLD 4810
mailto:eplanning@townsville.qld.gov.au
2011-09-11
North Shore Precinct 5 - Operational Works (Sewage Pump Station BU05 Rising Main and Gravity Sewer and Acid Sulphate Soils Test) associated with RC10/0189)
2011-08-30
OP11/0095
0 North Shore Boulevard BURDELL QLD 4818
mailto:eplanning@townsville.qld.gov.au
2011-09-11
North Shore Stage 520 - Operational Works associated with RC10/0189 (23 lots)
2011-09-05
OP11/0099
0 North Shore Boulevard BURDELL QLD 4818
mailto:eplanning@townsville.qld.gov.au
2011-09-11
Vacuum Truck Waste Composting and Soil Conditioning Manufacturing
2011-09-09
MC11/0073
111 Shaw Road SHAW QLD 4818
mailto:eplanning@townsville.qld.gov.au

To download data sign in with GitHub

Download table (as CSV) Download SQLite database (2.94 MB) Use the API

rows 10 / 3157

id name value_blob type
1
RC12/0052.04
RC12/0052.04
string
2
MC08/0299.11
MC08/0299.11
string
3
MI11/0046.03
MI11/0046.03
string
4
MI08/0077.06
MI08/0077.06
string
5
MC13/0020.01
MC13/0020.01
string
6
RC13/0046.02
RC13/0046.02
string
7
RC12/0010.10
RC12/0010.10
string
8
OP12/0113.11
OP12/0113.11
string
9
OP12/0109.09
OP12/0109.09
string
10
OP12/0104.23
OP12/0104.23
string

Statistics

Average successful run time: half a minute

Total run time: 2 days

Total cpu time used: 25 minutes

Total disk space used: 3.08 MB

History

  • Auto ran revision 91be8db3 and failed .
    nothing changed in the database
  • Auto ran revision 91be8db3 and failed .
    nothing changed in the database
  • Auto ran revision 91be8db3 and failed .
    nothing changed in the database
  • Auto ran revision 91be8db3 and completed successfully .
    160 records added, 157 records removed in the database
  • Auto ran revision 91be8db3 and completed successfully .
    158 records added, 149 records removed in the database
  • ...
  • Created on morph.io

Show complete history

Scraper code

Ruby

townsville / scraper.rb