Any way to speed up Selenium?

Hi

I am running a Python script on my Virtual Private Server which runs Unbuntu. The script uses Selenium to do some web scraping and interactions. As the server is headless, I use xvfb-run to generate a virtual display.

I am finding that the time to load each page is around 15 seconds. This is much slower than I would ultimately like!

Are there any tips to make this run faster?

Any advice would be much appreciated
LVL 2
aidebAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Craig KehlerDirector of Customer RelationsCommented:
Does the page take that long to fully load? Some times there are 3rd party javascripts that execute slowly on a page and can hold up the full page load while the rest of the page is interactive. Open the page with the network tab open in the debugger and see if there are any requests you don't care to have load, like ad services. Then you could hardcode those domains to the loopback address in your hosts file or use an adblocking service.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aidebAuthor Commented:
Hi Craig,
Thats a cracking idea. I will give it a go!

I did as you suggested and see that there are connections out to

bam.nr-data.net
cdn.optimizely.com
connect.facebook.net
*.cloudfront.net
js-agent.newrelic.com
platform.twitter.com
ssl.google-analytics.com
tracker.marinsm.com
use.typekit.net
www.dwin1.com
www.google-analytics.com
www.googletagmanager.com

I will try on my desktop first

Cheers
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Craig KehlerDirector of Customer RelationsCommented:
I'm left wondering if that solution actually worked for him. It did for me when I had a similar issue. He did at least find the idea valuable.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.