Selenium with wait
by decorative_quorum
Runs a simple selenium-based scrape of a site, but waits a given amount of time for the broswer to load the page
Opens on Apify.com
About Selenium with wait
Runs a simple selenium-based scrape of a site, but waits a given amount of time for the broswer to load the page
What does this actor do?
Selenium with wait is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.
Key Features
- Cloud-based execution - no local setup required
- Scalable infrastructure for large-scale operations
- API access for integration with your applications
- Built-in proxy rotation and anti-blocking measures
- Scheduled runs and webhooks for automation
How to Use
- Click "Try This Actor" to open it on Apify
- Create a free Apify account if you don't have one
- Configure the input parameters as needed
- Run the actor and download your results
Documentation
Selenium & Chrome template A template example built with Selenium and a headless Chrome browser to scrape a website and save the results to storage. The URL of the web page is passed in via input, which is defined by the input schema. The template uses the Selenium WebDriver to load and process the page. Enqueued URLs are stored in the default request queue. The data are then stored in the default dataset where you can easily access them. ## Included features - Apify SDK for Python - a toolkit for building Apify Actors and scrapers in Python - Input schema - define and easily validate a schema for your Actor's input - Request queue - queues into which you can put the URLs you want to scrape - Dataset - store structured data where each object stored has the same attributes - Selenium - a browser automation library ## How it works This code is a Python script that uses Selenium to scrape web pages and extract data from them. Here's a brief overview of how it works: - The script reads the input data from the Actor instance, which is expected to contain a start_urls key with a list of URLs to scrape and a max_depth key with the maximum depth of nested links to follow. - The script enqueues the starting URLs in the default request queue and sets their depth to 1. - The script processes the requests in the queue one by one, fetching the URL using requests and parsing it using Selenium. - If the depth of the current request is less than the maximum depth, the script looks for nested links in the page and enqueues their targets in the request queue with an incremented depth. - The script extracts the desired data from the page (in this case, titles of each page) and pushes them to the default dataset using the push_data method of the Actor instance. - The script catches any exceptions that occur during the web scraping process and logs an error message using the Actor.log.exception method. ## Resources - Selenium controlled Chrome example - Selenium Grid: what it is and how to set it up - Web scraping with Selenium and Python - Cypress vs. Selenium for web testing - Python tutorials in Academy - Video guide on getting scraped data using Apify API - A short guide on how to build web scrapers using code templates: web scraper template ## Getting started For complete information see this article. In short, you will: 1. Build the Actor 2. Run the Actor ## Pull the Actor for local development If you would like to develop locally, you can pull the existing Actor from Apify console using Apify CLI: 1. Install apify-cli Using Homebrew bash brew install apify-cli Using NPM bash npm -g install apify-cli 2. Pull the Actor by its unique <ActorId>, which is one of the following: - unique name of the Actor to pull (e.g. "apify/hello-world") - or ID of the Actor to pull (e.g. "E2jjCZBezvAZnX8Rb") You can find both by clicking on the Actor title at the top of the page, which will open a modal containing both Actor unique name and Actor ID. This command will copy the Actor into the current directory on your local machine. bash apify pull <ActorId> ## Documentation reference To learn more about Apify and Actors, take a look at the following resources: - Apify SDK for JavaScript documentation - Apify SDK for Python documentation - Apify Platform documentation - Join our developer community on Discord
Categories
Common Use Cases
Market Research
Gather competitive intelligence and market data
Lead Generation
Extract contact information for sales outreach
Price Monitoring
Track competitor pricing and product changes
Content Aggregation
Collect and organize content from multiple sources
Ready to Get Started?
Try Selenium with wait now on Apify. Free tier available with no credit card required.
Start Free TrialActor Information
- Developer
- decorative_quorum
- Pricing
- Paid
- Total Runs
- 25,009
- Active Users
- 83
Related Actors
Similarweb scraper
by curious_coder
Google Ads Scraper
by silva95gustavo
Cheap Google Search Results Scraper
by tuningsearch
G2 Explorer
by jupri
Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.
Learn more about ApifyNeed Professional Help?
Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.
Trusted by millions | Money-back guarantee | 24/7 Support