Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know a page is really fully loaded?

I am using python webkit.WebView and gtk to crawl a web page. However, the web page is kind of dynamically loaded by javascript.

The WebView "load-finished" event is not sufficient to handle this. Is there any indicator/event to let me know that the page is really fully loaded even the content produced by javascript?

Thanks,

like image 323
limi Avatar asked Dec 30 '12 19:12

limi


People also ask

How can I tell if a page has been fully loaded?

If their lenght is equal the htmls should be equal and that means the page is fully loaded.

How do I make sure the page is fully loaded javascript?

What is the best way to make sure javascript is running when page is fully loaded? If you mean "fully loaded" literally, i.e., all images and other resources downloaded, then you have to use an onload handler, e.g.: window. onload = function() { // Everything has loaded, so put your code here };

How do you execute a function when a page is fully loaded?

Method 1: Using onload method: The body of a webpage contains the actual content that is to be displayed. The onload event occurs whenever the element has finished loading. This can be used with the body element to execute a script after the webpage has completely loaded.

How do I know if angular is fully loaded?

map(url => false); // Iterate over the images urls. forEach((url, index) => { // Create an HTML image let img = new Image(); // Listen to its loading event img. onload = () => { // Image has loaded, save the information this. haveImagesLoaded[index] = true; // If all images have loaded, set your loader to false this.


1 Answers

There is no real way to determine if that page is fully loaded.

One method is to determine the amount of time since the last request. However, some pages will make repeated requests continually. This is common with tracking scripts and some ad scripts.

What I would do is use a set amount of time after the web view has said it finished loading... 5 seconds or so. It isn't perfect, but is the best you got, as there is no way to determine what "fully loaded" is for an arbitrary page.

like image 90
Brad Avatar answered Sep 20 '22 12:09

Brad