ActionScript 3.0 web scraper works in flash, but not browser -


So I have a problem I recently created a Flash WebCraft to capture a video source link. It works in Flash Does, however, when I do a test in the browser, I only get a blank canvas ... it does not work, I do not know what the problem is ... today I have now started learning activities, That's why I am the greatest.

  import flash.net Import flash. Arrangement.*; Import flash.display. *; Var theUrl = "http://www.sockshare.com/file/384F14398D224634"; First step (); Function first step () {var urlReq: URLRequest = new URLRequest (theUrl); UrlReq.method = URLRequestMethod.POST; Var loader: URL loader = new URL loader (urlReq); Loader.addEventListener (event.complete, onsite); Loader.dataFormat = URLLoaderDataFormat.TEXT; Loader.load (urlReq); Success on function (e: Event): zero {var theContents1: string = string (loader.data); Var pattern1: RegExp = / & lt; Input type = "hidden" value = "(? P & lt; internal text & gt;.)" Name = "hash" & gt; /; Var result1 = pattern1.exec (theContents1); GoToSecond (result1.innertext); }} Function goToSecond (hash: string) {var urlReq2: URLRequest = new URLRequest (theUrl); UrlReq2.method = URLRequestMethod.POST; Var urlVars2: URLVariables = new URLVariables (); UrlVars2.hash = hash; UrlVars2.confirm = 'Continue + Free + User'; UrlReq2.data = urlVars2; Var loader 2: URL loader = new URL loader (urlReq2); Loader2.addEventListener (event.complete, onsite2); Loader2.dataFormat = URLLoaderDataFormat.VARIABLES; Loader2.load (urlReq2); Success 2 on event (E: Event): Zero {var theContents2: string = string (loader2.data); Var Pattern: RegExp = /playlist%3A%20%27%2F(?P<innertext>.*?)%27%2C%0D%0A%09plugins/; Var result = pattern.exec (theContents2); Var linkp1: string = "http://www.sockshare.com/" + Unseasepep (result winner text); FinalStep (linkp1); }} Function Last Phase (Final URL: String) {var urlReq3: URLRequest = New URLRequest (finalUrl); UrlReq3.method = URLRequestMethod.POST; Var loader 3: URL loader = new URL loader (urlReq3); Loader3.addEventListener (event.complete, onsite3); Loader3.dataFormat = URLLoaderDataFormat.TEXT; Loader3.load (urlReq3); Success on function 3 (E: Event): Zero {var theContents3: string = string (loader3.data); Var pattern2: RegExp = / & lt; Media: Content URL = "(? P & lt; intertext & gt;?)" Type = "/; var result 2 = pattern2.exec (theContents3); var last links: string = result 2. winnertext; trace (last Link); mainText.text = finalLink;}}  

This is sandbox problem, read If you publish as standalone (ex: air) project then this will work


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -