This project is a Python-based automation solution designed for cross-browser testing using Selenium and BrowserStack. It performs the following tasks:
- Visit El País Website: Ensures the website is displayed in Spanish.
- Scrape Opinion Section: Fetches the first five articles, their titles, and content. Downloads cover images if available.
- Translate Article Titles: Uses an API to translate article titles from Spanish to English.
- Analyze Translated Titles: Identifies repeated words across translated titles and provides their count.
- Cross-Browser Testing: Executes tests in parallel on different desktop and mobile browsers using BrowserStack.
- Automated Web Scraping: Extracts article data and content dynamically.
- Image Handling: Downloads cover images of articles when available.
- Translation Support: Integrates with a translation API to process Spanish article titles.
- Parallel Execution: Tests are run across 5 browser configurations simultaneously for efficiency.
- Cross-Browser Compatibility: Ensures functionality on both desktop and mobile platforms.
- Programming Language: Python
- Browser Automation: Selenium WebDriver
- Cross-Browser Testing: BrowserStack
- Editor: VS Code
- Ensure the virtual environment is set up.
- Configure BrowserStack credentials and RapidAPI keys accordingly:
BrowserStack USERNAME = "your_browserstack_username"BrowserStack ACCESS_KEY = "your_browserstack_access_key"RAPIDAPI_KEY = "your_rapidapi_key"
- Run a sample test:
- To run these tests on Broswerstack running the following code via Terminal.
browserstack-sdk ./ElPaisScraper.py
- To run these tests on Broswerstack running the following code via Terminal.