Page 1 of 1

RevBrowserGet Differences

Posted: Tue Sep 28, 2010 9:53 pm
by lohill
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.

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
Any suggestions will be greatly appreciated,
Larry

Re: RevBrowserGet Differences

Posted: Wed Sep 29, 2010 5:31 am
by wsamples
Larry, TextEdit is rendering the html. You can get this to stop be going to "Preferences>Open and Save" and checking the box "Ignore rich text commands in HTML files". This will allow you to display raw html. Or, try another editor.

Re: RevBrowserGet Differences

Posted: Wed Sep 29, 2010 3:49 pm
by lohill
Thanks wsamples. I knew it had to be something simple. I think I'll just leave TextEdit that way.

Larry