Planning applications from all 35 London local planning authorities
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

26 linhas
936 B

  1. # This is a template for a Ruby scraper on morph.io (https://morph.io)
  2. # including some code snippets below that you should find helpful
  3. # require 'scraperwiki'
  4. # require 'mechanize'
  5. #
  6. # agent = Mechanize.new
  7. #
  8. # # Read in a page
  9. # page = agent.get("http://foo.com")
  10. #
  11. # # Find somehing on the page using css selectors
  12. # p page.at('div.content')
  13. #
  14. # # Write out to the sqlite database using scraperwiki library
  15. # ScraperWiki.save_sqlite(["name"], {"name" => "susan", "occupation" => "software developer"})
  16. #
  17. # # An arbitrary query against the database
  18. # ScraperWiki.select("* from data where 'name'='peter'")
  19. # You don't have to do things with the Mechanize or ScraperWiki libraries.
  20. # You can use whatever gems you want: https://morph.io/documentation/ruby
  21. # All that matters is that your final data is written to an SQLite database
  22. # called "data.sqlite" in the current working directory which has at least a table
  23. # called "data".