# How to get the table?

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-table/194148>\
**Category:** Ruby\
**Created:** [August 31, 2010, 4:31am UTC](https://www.ruby-forum.com/t/how-to-get-the-table/194148 "2010-08-31T04:31:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [August 31, 2010, 4:31am UTC](https://www.ruby-forum.com/t/how-to-get-the-table/194148/1 "2010-08-31T04:31:59Z")

</div>

please input in firefox,you can get the attachmeng  
[http://www.sec.gov/cgi-bin/viewer?action=view&cik=804328&accession\_number=0000950123-10-066837](http://www.sec.gov/cgi-bin/viewer?action=view&cik=804328&accession_number=0000950123-10-066837)

i write the code:  
require ‘rubygems’  
require ‘open-uri’  
web=‘[http://www.sec.gov/cgi-bin/viewer?action=view&cik=804328&accession\_number=0000950123-10-066837](http://www.sec.gov/cgi-bin/viewer?action=view&cik=804328&accession_number=0000950123-10-066837)’  
open(‘/tmp/file’,‘w’){|wfile|  
open(web){|webfile| wfile.puts webfile.read}}

what i get is not the attachment,can i write a program to get the  
contents of the attachment?  
any advice appriciated.

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [August 31, 2010, 11:47am UTC](https://www.ruby-forum.com/t/how-to-get-the-table/194148/2 "2010-08-31T11:47:19Z")

</div>

is there ruby edgar api to use?  
how to write a ruby edgar api?

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [August 31, 2010, 2:25pm UTC](https://www.ruby-forum.com/t/how-to-get-the-table/194148/3 "2010-08-31T14:25:05Z")

</div>

Have a look at the ‘mechanize’ and ‘nokogiri’ gems, if you want to  
scrape the HTML.

Otherwise, see if the data is provided in an alternate form more  
suitable for machine reading, such as a SOAP API, and then use the  
appropriate client side (e.g. ‘soap4r’)
