Skip to content

Instantly share code, notes, and snippets.

@camiloribeiro
Created October 26, 2012 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camiloribeiro/3961439 to your computer and use it in GitHub Desktop.
Save camiloribeiro/3961439 to your computer and use it in GitHub Desktop.
Get cpf numbers
require "watir-webdriver"
b = Watir::Browser.new
b.goto "http://www.geradordecpf.org/"
arr = Array.new
5000.times do |i|
b.button(:value => "Gerar").click
arr.push(b.text_field(:id => "numero").value)
puts "#{i} done"
end
file = File.open("cpfs","a") { |f| arr.each {|e| f.write e.to_s + "\n" } }
b.close
puts "It's done :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment