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 4540104
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:02:23+00:00 2026-05-21T15:02:23+00:00

i’m new to web apps so i’m not so used to worrying about CPU

  • 0

i’m new to web apps so i’m not so used to worrying about CPU limits, but i looks i am going to have a problem with this code. I read in google’s quotas page that i can use 6.5 CPU hours per day an 15 CPU , minutes per minute.

Google Said:

CPU time is reported in “seconds,” which is equivalent to the number of CPU cycles that
can be performed by a 1.2 GHz Intel x86 processor in that amount of time. The actual
number of CPU cycles spent varies greatly depending on conditions internal to App Engine,
so this number is adjusted for reporting purposes using this processor as a reference
measurement.

And

            Per Day          Max Rate
CPU Time    6.5 CPU-hours    15 CPU-minutes/minute

What i want to Know:

Is this script going over the limit?

(if yes)How can i make it not go over the limit?

I use the urllib library, should i use Google’s URL Fetch API? Why?

Absolutely any other helpful comment.

What it does:

It scrapes (crawls) project free TV. I will only completely run it once then replace it with a shorter faster script.

from urllib import urlopen
import re

alphaUrl = 'http://www.free-tv-video-online.me/movies/'
alphaPage = urlopen(alphaUrl).read()
patFinderAlpha = re.compile('<td width="97%" nowrap="true" class="mnlcategorylist"><a href="(.*)">')
findPatAlpha = re.findall(patFinderAlpha,alphaPage)
listIteratorAlpha = []
listIteratorAlpha[:] = range(len(findPatAlpha))
for ai in listIteratorAlpha:
    betaUrl = 'http://www.free-tv-video-online.me/movies/' + findPatAlpha[ai] + '/'
    betaPage = urlopen(betaUrl).read()
    patFinderBeta = re.compile('<td width="97%" class="mnlcategorylist"><a href="(.*)">')
    findPatBeta = re.findall(patFinderBeta,betaPage)
    listIteratorBeta = []
    listIteratorBeta[:] = range(len(findPatBeta))
    for bi in listIteratorBeta:
        gammaUrl = betaUrl + findPatBeta[bi]
        gammaPage = urlopen(gammaUrl).read()
        patFinderGamma = re.compile('<a href="(.*)" target="_blank" class="mnllinklist">')
        findPatGamma = re.findall(patFinderGamma,gammaPage)
        patFinderGamma2 = re.compile('<meta name="keywords"content="(.*)">')
        findPatGamma2 = re.findall(patFinderGamma2,gammaPage)
        listIteratorGamma = []
        listIteratorGamma[:] = range(len(findPatGamma))
        for gi in listIteratorGamma:
            deltaUrl = findPatGamma[gi]
            deltaPage = urlopen(deltaUrl).read()
            patFinderDelta = re.compile("<iframe id='hmovie' .* src='(.*)' .*></iframe>")
            findPatDelta = re.findall(patFinderDelta,deltaPage)
            PutData( findPatGamma2[gi], findPatAlpha[ai], findPatDelt)

If I forgot anything please let me know.

Update:

This is about how many times it will run and why in case this is helpfull in answering the question.

       per cycle      total
Alpha: 1              1
Beta:  16             16
Gamma: ~250           ~4000
Delta: ~6             ~24000
  • 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-05-21T15:02:24+00:00Added an answer on May 21, 2026 at 3:02 pm

    I don’t like to optimize until I need to. First, just try it. It might just work. If you go over quota, shrug, come back tomorrow.

    To split jobs into smaller parts, look at the Task Queue API. Maybe you can divide the workload into two queues, one that scrapes pages and one that processes them. You can put limits on the queues to control how aggressively they are run.

    P.S. On Regex for HTML: Do what works. The academics will call you out on semantic correctness, but if it works for you, don’t let that stop you.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small

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.