LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2008, 07:47 PM   #1
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Rep: Reputation: 16
need script or program for accessing webpage....


this is for testing and is in a save environment.. anyway I'm looking for command or script that would allow me to visit a web page like 5 times in a row, and then close, I tried lynx, and links, but they are text base browser and some things on the web page won't execute correctly like some java/html code.... so I decided to do something with firefox, and make it automatically and came with this little script it works, the only problem is that it waits for user input; like it waits for me to close the browser and then it moves to the next instruction...I would like to open pages x amount of times and each in a separate tab...I looked at firefox help but I couldn't find any commands for opening in different tabs, if anyone has a better idea, they are welcome...
here's the script...

Code:
A=0

while [ $A -le 5 ] ; do firefox http://website.com
count=`expr $A + 1`

done

killall firefox

exit
any help appreciated
 
Old 07-24-2008, 06:59 AM   #2
storkus
Member
 
Registered: Jun 2008
Location: Phoenix, Arizona, USA
Distribution: Slackware
Posts: 329

Rep: Reputation: 51
Quickie fix if this is a shell script would be to add the ampersand: "do firefox http://website.com &"
I'm sure there's a similar option in other scripting languages.

Other than that, I'm not real sure what to say, especially if there has to be any interaction with the web page, doubly so if via scripting.

I'm assuming you're just trying to load-test or balance the thing?

Mike
 
Old 07-24-2008, 07:38 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,344

Rep: Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746Reputation: 2746
Try Perl, using http://search.cpan.org/~petdance/WWW...W/Mechanize.pm
 
Old 07-25-2008, 09:09 AM   #4
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
there's something wrong either with my expression [ $A -le 5 ] or the counter is not working count=`expr $A + 1`
because it keeps looping forever


thanks
 
Old 07-25-2008, 09:15 AM   #5
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,449

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi

Shouldn't it be:
A=`expr $A + 1`
not
count=`expr $A + 1`
 
Old 07-25-2008, 10:34 AM   #6
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Guttorm View Post
Hi

Shouldn't it be:
A=`expr $A + 1`
not
count=`expr $A + 1`
you're right....missed that one :0)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to download a webpage pankaj99 Programming 4 09-23-2006 06:28 AM
a webpage downloader program needed pusrob Linux - Software 4 07-26-2006 08:00 AM
Accessing a webpage in C/C++ grub Programming 6 03-31-2005 11:55 PM
A Good Webpage program? Memzback Linux - Software 1 05-18-2004 09:22 PM
script to update my webpage yank_ Linux - General 0 02-16-2001 05:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration