How to get webpage data

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
fredjoans
Posts: 4
Joined: Wed Sep 12, 2018 8:56 pm

How to get webpage data

Post by fredjoans » Wed Sep 12, 2018 9:14 pm

Hello,

Hoping someone can help here. I can retrieve webpage data by using this format:

put url ("https://www. genericpage .com/generic_search.php?valid=y&active=y&Search=Search") into tReturnedData

But tReturnedData has what appears to be the page source html code.

What I would like to ask is how do I get the text data that would be displayed on the webpage.. not the page source, but the data displayed in the browser, I guess more like http GET /generic_search.php?valid=y&active=y&Search=Search.

-fj

Klaus
Posts: 10290
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: How to get webpage data

Post by Klaus » Wed Sep 12, 2018 9:27 pm

Hi Fred,

welcome to the forum!

There is a trick to extract the pure text from a HMTL page:

Code: Select all

...
lock screen

## Load HTML source into a field:
put url("https://www.genericpage.com/generic_search.php?valid=y&active=y&Search=Search") into fld 1

## Then (try) to see what the HTML source will display:
set the htmltext of fld 1 to the text of fld 1
...
LC only supports a little part of HTML code however, CSS is NOT supported unfortunately,
so this may not fit your needs, but give it a try. :D

Best

Klaus

fredjoans
Posts: 4
Joined: Wed Sep 12, 2018 8:56 pm

Re: How to get webpage data

Post by fredjoans » Wed Sep 12, 2018 9:49 pm

Klaus,

That will work! Very helpful, thanks a bunch for that bit of info. Very useful indeed.

-fj

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”