3

This is probably an imposible thing to do, but I want to ask. Is there a way to get the html source of a webpage by providing a link?

Gio
  • 1,954
  • 3
  • 22
  • 42
  • 1
    You could have at least accepted my answer if it helped you. Or let me know if it didn't. – Gio Sep 18 '12 at 14:17

1 Answers1

9

Of course there is. I don't see why you got so many negative votes. Anyway, here's a snippet for you:

var pageLoader:URLLoader = new URLLoader(); //make a loader that will load a page
var pageRequest:URLRequest = new URLRequest("http://google.com"); //make a request with a url to page
pageRequest.method = URLRequestMethod.GET; //set request's html request method to GET

pageLoader.addEventListener(Event.COMPLETE, onPageLoaded); //listen for page load
pageLoader.load(pageRequest); //actually load the page

function onPageLoaded(e:Event):void
{
    trace(pageLoader.data); //handle the data from the loader
}

You can also get a reference to your pageLoader instance from your handler function using the e.target. Good luck.

Gio
  • 1,954
  • 3
  • 22
  • 42