RevBrowserGet Differences
Posted: Tue Sep 28, 2010 9:53 pm
I am using the revBrowserGet command to get the htmltext so that I can parse it for the data I need from a web page. I got a version working on the Mac only to discover that importing it to the PC I get something that no longer works. In the debugging process I have been able to see that the htmltext on the Mac (Safari) and the htmltext on the PC (Explorer) are radically different. It appears that the 'text' from Safari' is maintaining many of it web page characteristics even though it is supposedly text. If I produce a .txt file on the PC and open it with NotePad, it looks like plain text. On the other hand the file produced on the Mac when opened in Text Edit looks like a striped down web page.
Here is some code I user to test this. I replace "<TR vAlign=top>" with an "*" to that I can later on use the '"*" as an item delimiter to examine the different records. That part is not shown here.
Any suggestions will be greatly appreciated,
Larry
Here is some code I user to test this. I replace "<TR vAlign=top>" with an "*" to that I can later on use the '"*" as an item delimiter to examine the different records. That part is not shown here.
Code: Select all
on mouseUp
global gPbrowserID
put revBrowserGet(gPbrowserId,"htmltext") into tHtml
replace quote with "" in tHtml
replace "<TR vAlign=top>" with "*" in tHtml
replace numToChar(13) with "" in tHtml
set the itemDelimiter to "*"
put the number of items of tHtml into tCount
ask file "Save this file as:" with filter "Text file, *.txt"
put it into tFileName
if tFileName is empty then exit mouseUp
if offset(".txt",tFilename) = 0 then
put ".txt" after tFileName
end if
open file tFileName
write tHtml to file tFileName
close file tFileName
end mouseUp
Larry