1

I am wondering how I can fill an online form automatically . I am new to ruby development , done this with python .

More Specifically i want to enter 10 digit pnr no "http://irctc-pnr-status.com/" and then click enter.

4

2 回答 2

2

只需将您的值作为参数lccp_pnrno1发送,然后解析 response.body

require 'net/http'
require 'uri'     
response = Net::HTTP.post_form(URI.parse('http://irctc-pnr-status.com/'), 
                               {'lccp_pnrno1'=>'VALUE'})
于 2013-04-09T08:06:09.167 回答
2

看看机械化宝石。这允许您以编程方式执行 Web 请求,包括填写表格和提交。

于 2013-04-09T08:06:16.790 回答