Closed

Optimize a CasperJS / PhantomJS script

I need an experienced programmer to optimize the attached .js script. It was written by a beginner and needs some professional care. Right now it consumes too much of CPU and RAM on a Linux based VPS and is not quite finished.

The script right now:

1) It gets executed from command line like this:

phantomjs --proxy=192.168.0.1:8085 --cookies-file=/var/cookies/[url removed, login to view] /var/[url removed, login to view] [url removed, login to view] [url removed, login to view]

All parameters are generated by an external script and are different each time (taken from DB).

2) The command executes phantomjs, but inside the script CasperJS is loaded.

3) The script at the moment visits the first URL, spends there some time and goes to the second URL, waits there, then it ends.

4) There are around 150 instances of the script running at the same time.

__________________________

What the script should be doing?

1) It should actually visit four URLs in a row, not two (all taken from command line as parameters)

2) There should be time (in seconds) passed as command line parameters for each URL, the script would stay (wait, sleep) this amount of seconds on each page

3) BIG CHANGE - instead of simply navigating between pages, i would like the script to simulate clicking <a href=""> tags on each page. What i mean is that somewhere on the first page will be an <a href="[url removed, login to view]"> tag, and so on. What is the best way to do that? The ideal solution is if i could specify

a) an <a> tag which contains specific href URL

b) or - an <a> tag of specific class or ID

4) There is viewportSize setting somewhere inside, but it doesn't have any effect

If you think you can help with this task, please wirte a few words about you, send a link to your portfolio or justify somehow why you are the best candidate for this task. Thanks a lot!

Skills: CasperJS, JavaScript, node.js, Software Architecture, Test Automation

See more: i need a linux programmer, help with vps, 192 168.1.1, phantomjs, need a link to your portfolio and, js script, casperjs, phantomjs casperjs python, best cpu, linux script seconds, functional testing web app using phantomjs casperjs, vps change, phantomjs casperjs test, 168 words, wait linux, proxy vps, file 8085, casperjs phantomjs, phantomjs casperjs, based vps

About the Employer:
( 20 reviews ) Szczecin, Poland

Project ID: #7115792

1 freelancer is bidding on average $166 for this job

paraggupta1993

Hey, I have some experience with PhantomJs as well as Selenium. I have contributed to testing frameworks such as Testium ([login to view URL]) Getting to the points. More

$166 USD in 5 days
(1 Review)
1.4