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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:05:04+00:00 2026-05-12T01:05:04+00:00

One of my clients needs to pull customer data from a web service periodically.

  • 0

One of my clients needs to pull customer data from a web service periodically. The data itself is provided as CSV files via javascript postbacks, as is most of the navigation within the service’s website.

Right now, the worst bottleneck in the entire system is the need for a human to log into the web page, navigate to the download page, and manually add the downloaded file to the rest of the system.

Can the process of downloading files via postback be automated? (Say for example via a shell script that can be run via cron?)

If so, what would you recommend as the most appropriate tool for doing so?

  • 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-12T01:05:05+00:00Added an answer on May 12, 2026 at 1:05 am

    In case anyone comes across this question again, I’ve found a solution:

    The trick is to use Mechanize, and a series of calls to Browser.submit() on the appropriate pages.

    The one hangup that others might also encounter is that ASP.NET pages (the biggest source of postback-based navigation, in my experience) also need a hidden parameter called __EVENTTARGET in the form, which won’t exist when you use mechanize.

    The __doPostBack('foo') function on these pages gives the relevant value to __EVENTTARGET via a javascript onclick event on each of the links, but since mechanize doesn’t use javascript you’ll need to set these values yourself.

    I made up a quick little utility function to use within my scripts that does this:

    def add_event_target(form, target):
        #Creates a new __EVENTTARGET control and adds the value specified
        #.NET doesn't generate this in mechanize for some reason -- suspect maybe is 
        #normally generated by javascript or some useragent thing?
        form.new_control('hidden','__EVENTTARGET',attrs = dict(name='__EVENTTARGET'))
        form.set_all_readonly(False)
        form["__EVENTTARGET"] = target
    

    I hope this is helpful for anyone who maybe comes across this question later.

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

Sidebar

Related Questions

I have a MySQL insert query which needs to pull one data field from
I have a server that receives various xml messages from clients (one thread per
I have a Windows program that needs to update itself from a server automatically.
I need to pull some data from the API. It returns the GET in
I need to create a web app for a client, and one of the
I'm trying to implement a system with two clients one of them sends a
One of my clients has added a number of account numbers in one of
One of my clients asked me to integrate an open source CMS in her
One of my clients uses Trend Micro InterScan Messaging Security to protect their internal
I wrote a simple CMS for one of my clients which does specifically what

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.