RB Kingston upon Thames planning applications
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

26 行
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".