Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:35:08+00:00 2026-06-13T05:35:08+00:00

Possible Duplicate: Webkit GTK: Determine when a document is finished loading I want to

  • 0

Possible Duplicate:
Webkit GTK: Determine when a document is finished loading

I want to fetch a website’s HTML contents with WebKitGTK+ to handle the javascript redirections automatically.

I am using the following Python code:

def scanURL(domain, retries=3):
    status = 0
    loading = 0

    browser = webkit.WebView()
    browser.open('http://' + domain)
    while browser.get_load_status() < 2:
        continue

    if browser.get_load_status() == 4:
        if retries > 0:
            return scanURL(domain, retries - 1)
        return 'Failed'

    return 'Success'

The website loads fine, but there are some special websites which are redirecting to a webpage redirecting somewhere else, I’ve tried to connect the load-finished event to a function, and it’s called twice.

Is there a way to know when WebKit has completely loaded a webpage ?

How can I know if WebKit is still executing some JavaScript code ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:35:09+00:00Added an answer on June 13, 2026 at 5:35 am

    There is no sure way to programatically accomplish that task for all websites, as there are pages where those redirections are initiated with javascript, often started by setTimeout after n-seconds, and there is no built-in method to scan for such “quirks”. However if you are parsing a known group of websites, where you surely know that such redirections will happen, you can create a list of those urls with the required number of seconds after which the redirection will happen. After an initial loadFinished is fired, you can start a QTimer, connect it’s signal to a function which will fire loadFinished again, so the next page load will surely start while you’re waiting for the result.
    Wait for the page result until there are no new loadStarted signals fired and no redirection needs to be done again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How to do the vector of sets in C++? I want to
Possible Duplicate: check whether internet connection is available with C# I just want to
Possible Duplicate: How to append text to an existing file in Java I want
Possible Duplicate: Unexpected token ILLEGAL in webkit I wrote a simple script for a
Possible Duplicate: jQuery HTML5 Speech Input I want create an search engine for my
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: How to embed WebKit into my C/C++/Win32 application? I am trying to
Possible Duplicate: Detect inside Android Browser or WebView i want to detect whether the
Possible Duplicate: iphone webkit css animations cause flicker For some reason, right before my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.