Script that Navigates Page needs Javascript Functionality

S

SMERSH009

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
 
7

7stud

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.
 
D

Dave Borne

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top