Script that Navigates Page needs Javascript Functionality

Discussion in 'Python' started by SMERSH009, Aug 4, 2007.

  1. SMERSH009

    SMERSH009 Guest

    I have a script that navigates pages and scrapes the HTML source of
    the page.
    in order to view the results I need I need python to "navigate to"
    this Javascript link:
    javascript:__doPostBack('ctl00$cpMain$pagerTop','4') This basically
    translates into "go to page 4."
    I read the posts on this group, and from what I understand, the
    functionality I need is with simplejson? If so, what is the syntax i
    would use to execute that Javascript?
    Or am I completely off base with using simplejson altogether?


    Thanks for the help
    -Sam
     
    SMERSH009, Aug 4, 2007
    #1
    1. Advertising

  2. SMERSH009

    7stud Guest

    On Aug 3, 7:58 pm, SMERSH009 <> wrote:
    > I have a script that navigates pages and scrapes the HTML source of
    > the page.
    > in order to view the results I need I need python to "navigate to"
    > this Javascript link:
    > javascript:__doPostBack('ctl00$cpMain$pagerTop','4') This basically
    > translates into "go to page 4."
    > I read the posts on this group, and from what I understand, the
    > functionality I need is with simplejson? If so, what is the syntax i
    > would use to execute that Javascript?
    > Or am I completely off base with using simplejson altogether?
    >
    > Thanks for the help
    > -Sam


    json is a specific way of formatting strings. If an application
    expects to receive a string as input and the string is supposed be
    formatted according to json, then you need to send the app a json
    formatted string.

    >From the brief description I just read of simplejson, it allows you to

    convert python objects to a string. What makes you think that
    simplejson has anything to do with executing javascript code?

    When html pages are sent to a browser, there is software in the
    browser that executes any javascript on the page. If you use python
    to download source code from a server, you are not loading anything in
    a browser, so no javascript executes.
     
    7stud, Aug 4, 2007
    #2
    1. Advertising

  3. SMERSH009

    Dave Borne Guest

    > in order to view the results I need I need python to "navigate to"
    > this Javascript link:
    > javascript:__doPostBack('ctl00$cpMain$pagerTop','4') This basically
    > translates into "go to page 4."
    > I read the posts on this group, and from what I understand, the
    > functionality I need is with simplejson? If so, what is the syntax i
    > would use to execute that Javascript?
    > Or am I completely off base with using simplejson altogether?


    I've been meaning to look into this library for interfacing with
    Mozilla's spidermonkey javascript engine:
    http://wwwsearch.sourceforge.net/python-spidermonkey/

    It sounds like it might do what you want, but I'm not sure how much
    work it would require.

    -Dave
     
    Dave Borne, Aug 6, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anirudha24.d
    Replies:
    0
    Views:
    1,720
    Anirudha24.d
    Feb 8, 2011
  2. Mel
    Replies:
    2
    Views:
    1,359
    Registered User
    Jun 2, 2011
  3. Phil Powell
    Replies:
    0
    Views:
    153
    Phil Powell
    Feb 16, 2004
  4. Vibhu
    Replies:
    4
    Views:
    472
    Chris
    Sep 29, 2004
  5. marco
    Replies:
    4
    Views:
    76
    marco
    Aug 19, 2006
Loading...

Share This Page