{"id":26896047,"url":"https://github.com/sofiasawczenko/get_flight_price_selenium","last_synced_at":"2025-04-01T02:59:30.520Z","repository":{"id":268725720,"uuid":"905276269","full_name":"sofiasawczenko/get_flight_price_selenium","owner":"sofiasawczenko","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-18T14:06:10.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-18T15:22:11.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sofiasawczenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-18T13:59:35.000Z","updated_at":"2024-12-18T14:06:14.000Z","dependencies_parsed_at":"2024-12-18T15:22:13.031Z","dependency_job_id":"53777a8b-4c24-4490-b107-f6e7c8200a93","html_url":"https://github.com/sofiasawczenko/get_flight_price_selenium","commit_stats":null,"previous_names":["sofiasawczenko/get_flight_price_selenium"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofiasawczenko%2Fget_flight_price_selenium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofiasawczenko%2Fget_flight_price_selenium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofiasawczenko%2Fget_flight_price_selenium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofiasawczenko%2Fget_flight_price_selenium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofiasawczenko","download_url":"https://codeload.github.com/sofiasawczenko/get_flight_price_selenium/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246574843,"owners_count":20799221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-01T02:59:29.963Z","updated_at":"2025-04-01T02:59:30.515Z","avatar_url":"https://github.com/sofiasawczenko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flight Price Tracker\n\nThis project is a simple Python script that uses **Selenium** to scrape the price of a flight from a specific URL and save it to a `.txt` file. The script is also scheduled to run every two weeks using the **schedule** library.\n\n## Features\n- Scrapes flight price from a URL.\n- Saves the price to a file (`price.txt`).\n- Runs the script automatically every 2 weeks.\n\n## Requirements\n- Python 3.x\n- Selenium\n- WebDriver for Chrome (ChromeDriver)\n- Schedule\n- Time module\n\n## Installation\n\n### 1. Install Python dependencies:\n   You need to install the necessary Python libraries to run the script:\n   ```bash\n   pip install selenium schedule\n```\n\n### 2. Install ChromeDriver: The script uses ChromeDriver to interact with the Chrome browser. Make sure you have the appropriate version of ChromeDriver installed for your version of Google Chrome.\n\nYou can download it from here: ChromeDriver.\n\nAlternatively, you can use webdriver-manager to automatically manage the WebDriver:\n\n```bash\npip install webdriver-manager\n```\n### How It Works\nThe script opens the URL provided (a Google Flights page in this case).\nIt scrapes the flight price using Selenium's find_element method.\nThe extracted price is saved to a text file named price.txt.\nThe script is scheduled to run every two weeks using the schedule library, which allows for periodic execution.\n\n### Running the Script\nYou can run the script manually or it will run automatically according to the schedule.\n\nTo start the script manually, simply run:\n\n   ```bash\npython flight_price_tracker.py\n```\nThe script will scrape the price, save it to the file, and then wait for the next scheduled run in 2 weeks.\n\n### Scheduling\nThe script is scheduled to run automatically every 2 weeks. You can adjust the scheduling frequency by modifying the schedule.every(2).weeks.do(get_flight_price) line in the code to other intervals, such as days, hours, or minutes.\n\n### Notes\nMake sure to have the Chrome browser installed on your machine and the appropriate ChromeDriver version.\nYou may need to configure additional options like headless mode or no-sandbox if you're running the script in environments without a graphical interface (like a server).\n\n### Example Output\nThe price will be saved in price.txt, with each run appending the most recent price.\n\nExample content in price.txt:\n   ```bash\n$200\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofiasawczenko%2Fget_flight_price_selenium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofiasawczenko%2Fget_flight_price_selenium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofiasawczenko%2Fget_flight_price_selenium/lists"}