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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:25:50+00:00 2026-06-08T01:25:50+00:00

I am new to python and havent found anything which suggests this is probably

  • 0

I am new to python and havent found anything which suggests this is probably dead easy.

The page I am scrapping is fairly simple but it completely updates every 2 minutes. I have managed to scrap all the data, but the issue is that even though the program runs every 2 minutes (I have tried through taskeng.exe and looping in the script), the html it is pulling from the website seems to refresh every 12 minutes. For the sake of clarity, the website I am scrapping has a time stamp when it updates. My program pulls that stamp (along with other data) and writes to a csv file. But its pulling the same data for 12 minutes and then suddenly the data arrives. So the output looks like:

16:30, Data1, Data2, Data3
16:30, Data1, Data2, Data3
...
16:30, Data1, Data2, Data3
16:42, Data1, Data2, Data3
16:42, Data1, Data2, Data3

where as it should be:

16:30, Data1, Data2, Data3
16:32, Data1, Data2, Data3
16:34, Data1, Data2, Data3
16:36, Data1, Data2, Data3
16:38, Data1, Data2, Data3
16:40, Data1, Data2, Data3
16:42, Data1, Data2, Data3

I think this has to do with the cache on myside. How can I force my http requests to completely refresh or force python to not store it in the cache?

I am using BeautifulSoup and Mechanize. My code for the http request is below:

mech = Browser()

url = "http://myurl.com"

page = mech.open(url)

html = page.read()
soup = BeautifulSoup(html)

If it helps to post all my code, I can do that. Thanks in advance for any advice

  • 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-08T01:25:52+00:00Added an answer on June 8, 2026 at 1:25 am

    You could use a simpler tool like requests.

    import requests
    response = requests.get(url)
    html = response.text
    

    But if you really want to stick with mechanize you can also skip the Browser() stuff (which is probably introducing cookies into your requests). Check the mechanize docs for more details.

    response = mechanize.urlopen("http://foo.bar.com/")
    html = response.read() # or readlines 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

new to python. This is probably simple but I haven't found an answer. rndStr
Brand new to Python (and programming in general), if this is simple and/or answered
New to Python, have a simple, situational question: Trying to use BeautifulSoup to parse
Very new to python and can't understand why this isn't working. I have a
I apologise if this question has already been asked. I'm really new to Python
I've got a page on my Python app which has a drop-down box of
I am new to Python and I haven't figured out a simple way of
I am very new with Python and I have just received this message while
I'm a new Python programmer who is making the leap from 2.6.4 to 3.1.1.
I'm a new Python programmer who is having a little trouble using 'self' in

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.