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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:17:28+00:00 2026-05-13T09:17:28+00:00

I need to scrape a simple webpage which has the following text: Value=29 Time=128769

  • 0

I need to scrape a simple webpage which has the following text:

Value=29
Time=128769

The values change frequently.

I want to extract the Value (29 in this case) and store it in a database. I want to scrape this page every 6 hours. I am not interested in displaying the value anywhere, I just am interested in the cron. Hope I made sense.

Please advise me if I can accomplish this using Google’s App Engine.

Thank you!

  • 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-13T09:17:28+00:00Added an answer on May 13, 2026 at 9:17 am

    Please advise me if I can accomplish
    this using Google’s App Engine.

    Sure! E.g., in Python, urlfetch (with the URL as argument) to get the contents, then a simple re.search(r'Value=(\d+)').group(1) (if the contents are as simple as you’re showing) to get the value, and a db.put to store it. Do you want the Python details spelled out, or do you prefer Java?

    Edit: urllib / urllib2 would also be feasible (GAE does support them now).

    So cron.yaml should be something like:

    cron:
    - description: refresh "value"
      url: /refvalue
      schedule: every 6 hours
    

    and app.yaml something like:

    application: valueref
    version: 1
    runtime: python
    api_version: 1
    
    handlers:
    - url: /refvalue
      script: refvalue.py
      login: admin
    

    You may have other entries in either or both, of course, but this is the subset needed to “refresh the value”. A possible refvalue.py might be:

    import re
    import wsgiref.handlers
    
    from google.appengine.ext import db
    from google.appengine.ext import webapp
    from google.appengine.api import urlfetch
    
    class Value(db.Model):
      thevalue = db.IntegerProperty()
      when = db.DateTimeProperty(auto_now_add=True)
    
    class RefValueHandler(webapp.RequestHandler):
      def get(self):
        resp = urlfetch.fetch('http://whatever.example.com')
        mo = re.match(r'Value=(\d+)', resp.content)
        if mo:
          val = int(mo.group(1))
        else:
          val = None
        valobj = Value(thevalue=val)
        valobj.put()
    
    def main():
      application = webapp.WSGIApplication(
        [('/refvalue', RefValueHandler),], debug=True)
      wsgiref.handlers.CGIHandler().run(application)
    
    if __name__ == '__main__':
      main()
    

    Depending on what else your web app is doing, you’ll probably want to move the class Value to a separate file (e.g. models.py with other models) which of course you’ll then have to import (from this .py file and from others which do something interesting with all of your saved values). Here I’ve taken some possible anomalies into account (no Value= found on the target page) but not others (the target page’s server does not respond or gives an error); it’s hard to know exactly what anomalies you need to consider and what you want to do if they occur (what I’m doing here is very simply recording None as the value at the anomaly’s time, but you may want to do more… or less — I’ll leave that up to you!-)

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

Sidebar

Ask A Question

Stats

  • Questions 259k
  • Answers 259k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer While I look at the following projects: http://www.iphone-recorder.com/about.html http://blog.pjsip.org/2009/02/19/native-iphone-sip-client-based-on-pjsip-available-on-app-store-open-source-and-not-tied-to-any-provider/ http://code.google.com/p/siphon/… May 13, 2026 at 11:12 am
  • Editorial Team
    Editorial Team added an answer As far as I know, plugins do not impact the… May 13, 2026 at 11:12 am
  • Editorial Team
    Editorial Team added an answer Time zones... the system may be working in UTC or,… May 13, 2026 at 11:12 am

Related Questions

Lets say I wanted to scrape a webpage, and extract some data. I'd most
I use Simple HTML DOM to scrape a page for the latest news, and
I'm currently using an IFrame to sandbox user generated content on a website. This
I've developed a rather simple OSK for our kiosk application. It works by opening
I have a relatively simple case. I basically want to store data about links

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.