[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: Good way to get quote from html file?



PureBytes Links

Trading Reference Links

Just parse/search the HTML with any language.  PERL is best for this stuff,
but any language can do it.  You would basically look for a pattern
repeating pattern.

You basically would have to hope the layout of the HTML is consistent for
all quotes.

Another option is to see if a webservice is available that would feed you
quotes in XML, CSV or some other format.  I think Yahoo might offer this.

-----Original Message-----
From: cash [mailto:ko.tseng@xxxxxxxxx] 
Sent: Thursday, November 11, 2004 10:43 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Good way to get quote from html file?



Thanks. I did try to put the file into Document structure and 
retrieve data elements via object collections. But I still cannot 
find how to do after searching for a while.

I got an idea from you with "replace". I might try JavaScript to 
replace "</td><td>" with "," and other tags with empty string. It's 
not neat but maybe workable. Thank you Dave for your idea.

kt 

--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
wrote:
> If you have Excel, it will open html files and convert them to a 
(clumsily
> formatted) spreadsheet. You can then save it as text from Excel, or 
copy the
> cells you're interested in and paste them into Notepad or some other
> text-only program.
> 
> If you don't have Excel, you could do a series of text replacements,
> removing each html tag in the file. If it's as simple as your 
example,
> removing table, tr, td and their closing tags would do it. A text 
editor
> that does regular expressions (pattern-based matching), like 
UltraEdit or
> SlickEdit, might make that easier.
> 
> None of these methods are great if you have to do this a lot, 
especially in
> real time, although I think Excel can do it with some programming. 
If that's
> your target and it was me, I'd consider writing a ColdFusion 
program to do
> it, but then again, that's what I do professionally (:-). You could 
also do
> it in VB, perl, java, probably any language that speaks web.
> 
> Dave Merrill
> 
>     Is there a good way to retrieve quote from a html file? Ex. I 
want
>   to remove tags from a html file contain EOD data. Thanks a lot.
> 
>   kt
> 
>   ------------------------------------------------------------
> 
>   <table>
>   <tr>
>   <td>stock name</td><td>close price</td>
>   </tr>
>   <tr>
>   <td>abc</td><td>20.5</td>
>   </tr>
>   <tr>
>   <td>def</td><td>100</td>
>   </tr>
>   </table>
> 
> 
> [Non-text portions of this message have been removed]






Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/