You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I'm loading a certain page, but the actual data that I want to scrape is set by a script trough a webworker. It listens to a stream on a different endpoint to get the actual values.
Question1: Are webworkers supposed to run? (probably not).
Question2 if answer#1 is no: Is it possible to inject the script to the page to try and execute it.
Question3 if answer#2 is no: what would need to be done to make webworkers run? I might take a shot at it.
For the curious, my code so far:
IConfigurationangleSharpConfig=Configuration.Default.WithDefaultLoader(newLoaderOptions{IsResourceLoadingEnabled=true}).WithDefaultCookies().WithJs();try{stringcookieValue=String.Empty;IBrowsingContextangleSharpContext=BrowsingContext.New(angleSharpConfig);stringbaseUrl=Regex.Match(sensor.Url,@"^https?:\/+([\d+|\.])+\/").Groups[0].ToString();stringloginUrl=$@"{baseUrl}cgi/login?username={usr}&password={pass}";using(WebClientclient=newWebClient()){stringloginInfo=client.DownloadString(loginUrl);cookieValue=loginInfo.Split(new[]{"\n",Environment.NewLine},StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(sx =>sx.Contains("="));angleSharpContext.SetCookie(newUrl(baseUrl),cookieValue);}IDocumentdocument=awaitangleSharpContext.OpenAsync(sensor.Url).WaitUntilAvailable();IHtmlCollection<IElement>t=document.QuerySelectorAll("#m1_page1 [data-sid]");//At this point the elements have default values and not yet set by the script despite using WaitUntilAvailable}
The text was updated successfully, but these errors were encountered:
Question1: Are webworkers supposed to run? (probably not).
Right now there is no WebWorker support. But I think adding them is possible (and is a good addition).
Question2 if answer#1 is no: Is it possible to inject the script to the page to try and execute it.
Well, a web worker would not work in standard DOM. Usually, the scripts behind web workers only work in the worker context, as they'd use the worker specific APIs for communication and computation.
So I guess "no" again.
Question3 if answer#2 is no: what would need to be done to make webworkers run? I might take a shot at it.
Loading the referenced script is possible by going against the services of the associated browsing context. In there the resource loader should be used.
So I'm loading a certain page, but the actual data that I want to scrape is set by a script trough a webworker. It listens to a stream on a different endpoint to get the actual values.
Question1: Are webworkers supposed to run? (probably not).
Question2 if answer#1 is no: Is it possible to inject the script to the page to try and execute it.
Question3 if answer#2 is no: what would need to be done to make webworkers run? I might take a shot at it.
For the curious, my code so far:
The text was updated successfully, but these errors were encountered: