On Jul 23, 2013, at 5:29 PM, Austin J. <lists / ruby-forum.com> wrote:
> So someone helped me out and made a code for Ruby.
> This is the code.
>=20
> $ ruby -rmechanize -e'n=3D(1..600); a=3DMechanize.new; n.each{|j|
> o=3Da.get("http://rslsim.atspace.com/html/players/player#{j}stats.htm");=

> b=3Do.search("tr"); [1,2,4].each{|q| puts b[q].search("td").map{|i|
> i.text}.join(",") } } ' > data.csv
>=20
> Can someone convert this into a windows code possibly or tell me what
> I'm doing wrong? I know it can be done because he did it on Linux but
> doesn't know how to do it on Windows.


Your problem isn't with the ruby code, it's with the difference between =
a linux shell and windows cmd.exe.

Take the code between the first ' and the last ' and put it in a file =
called, say, 'scrape.rb'. Then change the command to:

C:\> ruby -rmechanize scrape.rb > data.csv