Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I found a good standalone javascript interpreter (PhantomJS) and have written a few scripts that it can execute. I want to execute automatically what a page does (specifically, the county assessor's page that returns records for a parcel by its id). The page has a bunch of scripts, most of them not labeled, including the function I want. Can someone point me to some instructions on how to tease out of a page the functionality one wants?
If scripts aren't labeled do they execute in the order they appear in a page? Or must there be an event (e.g., a key click or a mouse rollover)?
I'll try and answer what I think the question is. I don't know of any way to tease script functions out of a webpage. When I want to take a function from a page I find somewhere else, I use Firefox's Web Developer > Inspector function. It will show you the page code and, as you hover over parts of the page, you can see what sections of code correspond to what on the page. Firefox also has a neat addon, Firebug, which can accomplish the opposite, where when you hover over a section of code it will show what it corresponds to on a page.
As for scripting on a page, they can be event driven, ordered or unordered. Unordered & non-event driven would usually mean they just load up as they load up, top to bottom, but showing up whenever they finish loading.
I want to fetch the ownership records of 167 parcels. I could fetch them all by hand; I'd rather not. The county assessor, who keeps the records, the website used to use a fetching mechanism I could automate the fetching of records from with lynx and the right argument. Now it uses javascript. The button of the page that activates the fetching of a record is a function, _doPostBack(SomeLongArgument) , inside an unlabeled script in a webpage.
I want to make that button do its work with an argument I specify. The button is inside an unlabeled javascript. From the examples on phantomjs.org it seems that I would use phantomjs to 'load' the page (load may not be the right word) and cause the execution of this script. But the script isn't labeled. (Some are.) If a javascript has a URI I can just execute it, but this javascript is in a page and has no label: how do I get it to execute? Pass it an argument?
Everything points to needing that URI to execute against. I don't have time tonight to look further, but perhaps there is a way of injecting the URI? What is your opinion on that?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.