Reputation: 1
I am trying to crawl multiple webpages using a single script. At the moment I have individual scripts for each URL I want to visit. But I was wondering if its possible for 1) A single script to take you to multiple pages and do desired actions? 2)A script that asks user for URL address and then does standard actions and keeps prompting for more URLs till user wishes to finish.
Upvotes: 0
Views: 311
Reputation: 3311
Do some research into "data driven testing" and "parameterized tests" with Selenium. You'll be able to have a data source (CSV file, inline definition, database, whatever) to read from then do your standard actions. You could also prompt the user instead of having every site defined at the start in a datasource, but that would take away many of the benefits of having everything scripted.
A really basic Python implementation of data driven Selenium can be seen here.
Upvotes: 1