Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting html --> text document
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00710635
Message ID:
00795980
Vues:
37
>Vincent,
>
>Do you mind sending me the original HTML file? I would like to look into it and might be able to help.
>
>
>
>
>>Hi Nancy,
>>
>>Yes, old thread already! Sorry!
>>
>>The data are not fixed width, it is very difficult to capture into table. I will try other method. Thank you very much for help.

Hi Wan,

Here is my source code as following:

**start----
FOR i = 1 TO 9
mcall = "http:///biz.thestar.com.my/marketwatch/bizmain.asp?closingprice="+ ALLTRIM(STR(i))
mcall = "http:///biz.thestar.com.my/marketwatch/bizmain.asp?closingprice=1"

release o, odoc, otext
LOCAL oie as internetexplorer.application

oIE = createobject( "internetexplorer.application" )

oIE.Visible = .t.

oIE.Navigate( mcall )

do wait_for_page

oDoc = oIE.Document
oText = oDoc.documentElement.innerhtml
*oText = oDoc.documentElement.innerText
*oText = oDoc.body.innerText
*oText = oDoc.body.outerTEXT
*oText = oDoc.body.innerhtml
**<<-- body vs documentElement
lcMyfile = "c:\Myindex"+ALLTRIM(STR(i))+".html"
StrToFile(oText, lcMyfile)
modi comm &lcMyfile

oie.Quit

next

*****************************************************
proc wait_for_page

stime = time()
do while oie.Busy
wait wind "Please wait... Internet Explorer is busy " + time() time 1
enddo
do while lower(oie.Document.ReadyState) not "complete"
wait wind "Please wait...while page downloads " time 1
enddo
endproc
**end---

My output files name is "myindex1.html" up to 9 files. It contains of share market index data. I want to capture the data and append into foxpro table as a analysis data. In html format, I don't know how to retrieve the data because have html tag. If I using the oDoc.documentElement.innerText then the output file data will be group together no space in between. So I can't use the command "append from myindex1.txt type delimited with tab" append the data directly. How do you solve this problem? Hope you can help me, thank you very much.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform