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

  • Home
  • SEARCH
  • 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 8721917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:18:03+00:00 2026-06-13T07:18:03+00:00

I have written a scraper that does html scraping and then use API to

  • 0

I have written a scraper that does html scraping and then use API to get some data, since its a very lengthy code I haven’t put it here. I have implemented random sleep method and using it within my code to monitor throttle. But I want to make sure I don’t over run this code, so my idea is to run for an 3-4 hours then taker breather and then run again. I haven’t done anything like this in python I was trying to search but not really sure where to start from, it would be great if I get some guidance on this. If python has a specific module link to that would be a great help.

Also is this relevant? I don’t I need this level of complication?

Suggestions for a Cron like scheduler in Python?

I have functions for every single scraping task, and I have main method calling all those functions.

  • 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-13T07:18:03+00:00Added an answer on June 13, 2026 at 7:18 am

    You can use a threading.Timer object to schedule an interrupt signal to the main thread after the time is exceeded:

    import thread, threading
    
    def longjob():
        try:
            # do your job
            while True:
                print '*', 
        except KeyboardInterrupt:
            # do your cleanup
            print 'ok, giving up'
    
    def terminate():
        print 'sorry, pal'
        thread.interrupt_main()
    
    time_limit = 5  # terminate in 5 seconds
    threading.Timer(time_limit, terminate).start()
    longjob()
    

    Put this in your crontab and run every time_limit + 2 minutes.

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

Sidebar

Related Questions

I have written a Hive UDF that does decryption using an in-house API as
I have written a function that sorts a big scale of data. To test
I am trying to get cell4 value that is written in a HTML table
I have written a generic CSV file reader that I'm trying to use to
I have written a scrapy spider to scrape out some html tags. Now the
I have written some code in my VB.NET application to send an HTML e-mail
I have written a web scraper in ruby . But the websites that I
Have written a Binary Search Tree that stores data on ships, the key for
I have written a function that extract the domain from hostname. e.g. www.domain.com ->
I have written some Python scripts in Eclipse where at some point I have

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.