{"id":28735261,"url":"https://github.com/og-gy/python-selenium-browser-automation-examples","last_synced_at":"2026-05-02T06:39:35.371Z","repository":{"id":265276803,"uuid":"895084440","full_name":"OG-GY/python-selenium-browser-automation-examples","owner":"OG-GY","description":"Features: Highlight key capabilities of your script (e.g., \"Automates web tasks like logging in, clicking buttons, scraping data\"). Usage: Step-by-step guide on how users can clone, install, and use the script. Example Script: Include example usage, as you've already done. Method Breakdown: Add the table with methods (as we discussed) for reference","archived":false,"fork":false,"pushed_at":"2024-11-28T17:06:44.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T00:34:58.092Z","etag":null,"topics":["automation","python","selenium","web-scraping","webdriver"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OG-GY.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-11-27T14:30:33.000Z","updated_at":"2025-06-20T14:36:06.000Z","dependencies_parsed_at":"2024-11-28T17:40:53.484Z","dependency_job_id":null,"html_url":"https://github.com/OG-GY/python-selenium-browser-automation-examples","commit_stats":null,"previous_names":["aprun/selenium_methods","oggy-bhai/python-selenium-browser-automation-examples","aprun/python-selenium-browser-automation-examples","og-gy/python-selenium-browser-automation-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OG-GY/python-selenium-browser-automation-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OG-GY%2Fpython-selenium-browser-automation-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OG-GY%2Fpython-selenium-browser-automation-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OG-GY%2Fpython-selenium-browser-automation-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OG-GY%2Fpython-selenium-browser-automation-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OG-GY","download_url":"https://codeload.github.com/OG-GY/python-selenium-browser-automation-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OG-GY%2Fpython-selenium-browser-automation-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32525896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","python","selenium","web-scraping","webdriver"],"created_at":"2025-06-16T00:14:33.822Z","updated_at":"2026-05-02T06:39:35.349Z","avatar_url":"https://github.com/OG-GY.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started with Selenium Automation Script 🖥️  \n\nThis repository contains a Python script for automating browser interactions using Selenium WebDriver. It provides examples of various Selenium methods to perform tasks such as navigation, element interaction, and more.\n\n---\n\n## 🚀 Features  \n- Open and interact with web pages.  \n- Automate browser actions like clicking, typing, and navigating.  \n- Manage browser cookies, alerts, and frames.  \n- Perform window and tab management.  \n\n---\n\n## 📝 Usage  \n\n### 1. Clone the Repository  \n```bash  \ngit clone https://github.com/username/repository-name.git  \n```\n\n### 2. Install Dependencies\n```bash  \npip install selenium  \n```\n### 3. Run the Script\nMake sure you have ChromeDriver installed and set up before running the script.\n```bash  \npython script.py  \n```\n\n## 📚 Resources\n[Selenium with Python Guide](https://selenium-python.readthedocs.io/)\n\n\n## Some More Methods\n\n| **Method**                         | **Description**                                                                   |\n|-------------------------------------|-----------------------------------------------------------------------------------|\n| `get(url)`                          | Opens a specified URL in the browser.                                             |\n| `minimize_window()`                 | Minimizes the current window.                                                     |\n| `maximize_window()`                 | Maximizes the current window.                                                     |\n| `refresh()`                         | Refreshes the current web page.                                                   |\n| `current_url`                       | Retrieves the URL of the current page.                                            |\n| `quit()`                            | Closes all browser windows and terminates the WebDriver session.                  |\n| `find_element(By.selector)`         | Finds an element using the given selector.                                        |\n| `find_elements(By.selector)`        | Finds all elements matching the given selector.                                   |\n| `click()`                           | Simulates a mouse click on the element.                                           |\n| `send_keys(keys)`                   | Types the specified keys into an input field.                                     |\n| `back()`                            | Navigates to the previous page in history.                                        |\n| `forward()`                         | Moves to the next page in history.                                               |\n| `assert \"text\" in driver.title`     | Validates that the title contains the specified text.                             |\n| `get_title()`                       | Gets the title of the current page.                                               |\n| `get_window_position()`             | Returns the position of the current window.                                       |\n| `get_window_size()`                 | Returns the size of the current window.                                           |\n| `switch_to.frame()`                 | Switches focus to a specified frame.                                              |\n| `switch_to.default_content()`       | Switches focus back to the main content.                                          |\n| `switch_to.alert()`                 | Switches focus to the current alert box.                                          |\n| `accept()`                          | Accepts the current alert.                                                        |\n| `dismiss()`                         | Dismisses the current alert.                                                      |\n| `send_keys_to_alert(text)`          | Sends text to the current alert.                                                  |\n| `get_cookies()`                     | Returns all cookies for the current domain.                                       |\n| `add_cookie(cookie_dict)`           | Adds a cookie to the current session.                                             |\n| `delete_cookie(name)`               | Deletes a specific cookie by name.                                                |\n| `delete_all_cookies()`              | Deletes all cookies in the current session.                                       |\n| `execute_script(script)`            | Executes a JavaScript script in the context of the current page.                  |\n| `execute_async_script(script)`      | Executes an asynchronous JavaScript script.                                       |\n| `get_window_handles()`              | Retrieves all window handles for the current session.                             |\n| `switch_to.window(handle)`          | Switches focus to the window with the given handle.                               |\n| `close()`                           | Closes the current window.                                                        |\n| `get_screenshot_as_file(filename)`  | Captures a screenshot of the current page and saves it to a file.                 |\n| `get_screenshot_as_base64()`        | Captures a screenshot and returns it as a base64-encoded PNG image.               |\n| `get_screenshot_as_png()`           | Captures a screenshot and returns it as a PNG image.                              |\n| `find_element_by_id(id)`            | Finds an element by its ID attribute.                                              |\n| `find_element_by_name(name)`        | Finds an element by its name attribute.                                            |\n| `find_element_by_class_name(name)`  | Finds an element by its class name.                                               |\n| `find_element_by_tag_name(name)`    | Finds an element by its tag name.                                                 |\n| `find_element_by_xpath(xpath)`      | Finds an element by its XPath expression.                                         |\n| `find_element_by_css_selector(css)` | Finds an element by its CSS selector.                                             |\n| `find_elements_by_id(id)`           | Finds multiple elements by their ID attribute.                                    |\n| `find_elements_by_name(name)`       | Finds multiple elements by their name attribute.                                  |\n| `find_elements_by_class_name(name)` | Finds multiple elements by their class name.                                      |\n| `find_elements_by_tag_name(name)`   | Finds multiple elements by their tag name.                                        |\n| `find_elements_by_xpath(xpath)`     | Finds multiple elements by their XPath expression.                               |\n| `find_elements_by_css_selector(css)`| Finds multiple elements by their CSS selector.                                    |\n| `set_page_load_timeout(time)`       | Sets the amount of time to wait for a page to load before throwing an error.       |\n| `set_script_timeout(time)`          | Sets the amount of time to wait for a script to finish before throwing an error.   |\n| `implicitly_wait(time)`             | Sets an implicit wait time for locating elements.                                 |\n| `clear()`                           | Clears the value of an input element.                                             |\n| `is_displayed()`                    | Checks if an element is visible on the page.                                      |\n| `is_enabled()`                      | Checks if an element is enabled.                                                  |\n| `is_selected()`                     | Checks if an element is selected (e.g., checkboxes, radio buttons).                |\n| `get_attribute(attribute_name)`     | Gets the value of a specified attribute from an element.                          |\n| `get_text()`                        | Retrieves the visible text within an element.                                     |\n| `get_css_value(property_name)`      | Retrieves the CSS value of a specified property of an element.                    |\n| `submit()`                          | Submits a form (similar to clicking the submit button).                           |\n| `scroll_to_element(element)`        | Scrolls the page to bring the specified element into view.                        |\n| `scroll_to_top()`                   | Scrolls the page to the top.                                                     |\n| `scroll_to_bottom()`                | Scrolls the page to the bottom.                                                  |\n| `wait.until(condition)`             | Waits for a specified condition to be met before proceeding.                      |\n| `alert.text()`                      | Retrieves the text of the current alert box.                                      |\n| `alert.send_keys(keys)`             | Sends keys to the current alert box.                                              |\n| `alert.accept()`                    | Accepts the alert.                                                               |\n| `alert.dismiss()`                   | Dismisses the alert.                                                             |\n| `alert.is_displayed()`              | Checks if an alert is currently displayed.                                        |\n| `get_log(type)`                     | Retrieves logs of the specified type (e.g., \"browser\", \"driver\", etc.).           |\n\n\n\n![Build Status](https://img.shields.io/badge/build-passing-brightgreen)\n![License](https://img.shields.io/badge/license-MIT-blue)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fog-gy%2Fpython-selenium-browser-automation-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fog-gy%2Fpython-selenium-browser-automation-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fog-gy%2Fpython-selenium-browser-automation-examples/lists"}