Code: Select all
put url ("http://domain.com/examples.php") into field "fld1"
put characters 1 to 39 into field "fld1"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
put url ("http://domain.com/examples.php") into field "fld1"
put characters 1 to 39 into field "fld1"
Code: Select all
put char 1 to 39 of field "fld1" into field "fld1"
Ah. Thank you Simon. That helps a lot. So when I do something like that I need a From ----> To, then I can limit the text. Got it. Thank you again.Simon wrote:You're almost there:you need a from-toCode: Select all
put char 1 to 39 of field "fld1" into field "fld1"
Simon
Sometimes. The challenge with web scraping is that HTML offers so much flexibility that really the only way to traverse its elements reliably is through the DOM, which would require using JavaScript in a LiveCode browser object.Maxiogee wrote:Is there a way to just obtain the text displayed to the viewer of a web-page?
Code: Select all
function HtmlToText pHtml
-- Save the state of the templateField:
put the properties of the templateField into tSaveProps
-- Set the htmlText, obtain the text:
set the htmlText of the templateField to pHtml
put the text of the templateField into tText
-- Restore the state of the templateField:
set the properties of the templateField to tSaveProps
-- Return the text:
return tText
end HtmlToText