You must write a ruby ​​script to create a CSV data file on the website

There is a website that gives me information about PIN codes for a certain state, such as an Indian postal website , gives details when I select a state from the drop-down list.

I need to write a script in ruby ​​that will create a CSV file with all the data for a specific state.

Today is my first day at ruby ​​and not sure how to approach this. Any help in the right direction would be appreciated.

thanks

+3
source share
4 answers

You must be interested in gemaster FasterCSV

http://fastercsv.rubyforge.org/

gem install fastercsv

And here is something like this:

require 'fastercsv'
FasterCSV.open("temp.csv", "w") do |csv|
  csv << ["line1row1", "line1row2"]
  csv << ["line2row1", "line2row2"]
  # ...
end
+12

/ .

  • - - ?
  • , Net:: HTTP , ,
  • , (, )?

, - , . irb . CSV , - (, , ).

:

+2

, :

Google. , Ruby Ruby.

+2

, bankjob, , -.

, bankjob.rubyforge.org.

Bankjob Mechanize, Hpricot ( ), - CSV ( OFX, - , CSV ).

, , Bankjob , , , , ( ), csv -csv.

+1

Source: https://habr.com/ru/post/1705045/


All Articles