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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:48:17+00:00 2026-05-11T18:48:17+00:00

I’m trying to extract data from the following page: http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet?param1=&param2=&param3=&param4=&param5=2009-04-22&param6=37# Which, conveniently and inefficiently

  • 0

I’m trying to extract data from the following page:

http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet?param1=&param2=&param3=&param4=&param5=2009-04-22&param6=37#

Which, conveniently and inefficiently enough, includes all the data embedded as a csv file in the header, set as a variable called gs_csv.

How do I extract this? Document.body.innerhtml skips the header where the data is, what is the alternative that includes the header (or better yet, the value associated with gs_csv)?

(Sorry, new to all this, I’ve been searching through loads of documentation, and trying a lot of them, but nothing so far has worked).


Thanks to Sinan (this is mostly his solution transcribed into Python).

import win32com.client 

import time 

import os 

import os.path

ie = Dispatch("InternetExplorer.Application") 

ie.Visible=False 

ie.Navigate("http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet?param1=&param2=&param3=&param4=&param5=2009-04-22&param6=37#")

time.sleep(20)

webpage=ie.document.body.innerHTML

s1=ie.document.scripts(1).text 

s1=s1[s1.find("gs_csv")+8:-11]

scriptfilepath="c:\FO Share\bmreports\script.txt" 

scriptfile = open(scriptfilepath, 'wb') 

scriptfile.write(s1.replace('\n','\n')) 

scriptfile.close()

ie.quit
  • 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-11T18:48:17+00:00Added an answer on May 11, 2026 at 6:48 pm

    Untested: Did you try looking at what Document.scripts contains?

    UPDATE:

    For some reason, I am having immense difficulty getting this to work using the Windows Scripting Host (but then, I don’t use it very often, apologies). Anyway, here is the Perl source that works:

    use strict;
    use warnings;
    
    use Win32::OLE;
    $Win32::OLE::Warn = 3;
    
    my $ie = get_ie();
    
    $ie->{Visible} = 1;
    
    $ie->Navigate(
        'http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBMDataServlet?'
        .'param1=&param2=&param3=&param4=&param5=2009-04-22&param6=37#'
    );
    
    sleep 1 until is_ready( $ie );
    
    my $scripts = $ie->Document->{scripts};
    
    for my $script (in $scripts ) {
        print $script->text;
    }
    
    sub is_ready { $_[0]->{ReadyState} == 4 }
    
    sub get_ie {
        Win32::OLE->new('InternetExplorer.Application', 
            sub { $_[0] and $_[0]->Quit },
        );
    }
    
    __END__
    
    C:\Temp> ie > output
    

    output now contains everything within the script tags.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This should cover all 3 of your requirements. Excuse the… May 12, 2026 at 1:34 pm
  • Editorial Team
    Editorial Team added an answer This is the correct answer, the older answers are wrong… May 12, 2026 at 1:34 pm
  • Editorial Team
    Editorial Team added an answer Where did you find out that it downloads the entire… May 12, 2026 at 1:34 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
In order to apply a triggered animation to all ToolTip s in my app,
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

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.