Get external page source?

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 383
Joined: Mon Mar 01, 2010 7:13 pm
Contact:

Get external page source?

Post by thatkeith » Mon Jul 07, 2025 3:39 pm

Can someone suggest a good way, in a LC server-based thing, to grab the HTML source of an external URL for parsing? It's easy in the regular desktop LC:

Code: Select all

   launch url pURL in widget "site"
   put the htmlText of widget "site" into tSource
But I see that launch url doesn't include server in the supported platforms, and I get (unsurprisingly) an 'Internal Server Error' when I try it anyway.

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get external page source?

Post by FourthWorld » Tue Jul 08, 2025 5:30 am

This can be tricky in a world where web content is increasingly assembled dynamically in divs with JS.

If just getting the URL isn't doing what you need, that may be the issue.

Does the host offer an API to get the data you're looking for? Can you tell us more about the page?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply