{"id":17919227,"url":"https://github.com/fastestmolasses/fbrowser","last_synced_at":"2025-03-24T00:31:22.389Z","repository":{"id":57428818,"uuid":"152545126","full_name":"FastestMolasses/fBrowser","owner":"FastestMolasses","description":"Helpful Selenium functions to make web-scraping easier and faster","archived":false,"fork":false,"pushed_at":"2019-11-12T15:09:14.000Z","size":22,"stargazers_count":18,"open_issues_count":0,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-15T07:05:14.080Z","etag":null,"topics":["helper-functions","python3","selenium","selenium-functions","selenium-python","webscraper","webscraping"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FastestMolasses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-11T06:53:45.000Z","updated_at":"2024-10-27T18:17:49.000Z","dependencies_parsed_at":"2022-09-19T05:11:40.776Z","dependency_job_id":null,"html_url":"https://github.com/FastestMolasses/fBrowser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastestMolasses%2FfBrowser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastestMolasses%2FfBrowser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastestMolasses%2FfBrowser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FastestMolasses%2FfBrowser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FastestMolasses","download_url":"https://codeload.github.com/FastestMolasses/fBrowser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191062,"owners_count":20575244,"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":["helper-functions","python3","selenium","selenium-functions","selenium-python","webscraper","webscraping"],"created_at":"2024-10-28T20:15:34.200Z","updated_at":"2025-03-24T00:31:22.148Z","avatar_url":"https://github.com/FastestMolasses.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fBrowser | Quick-start Your Selenium Project\n\nThis library was created in order to help users quick-start their webscraping project. It includes several useful functions including a browser handler, new tab functionality, and more.\n\n## Installation\n\n```\n$ pip3 install fBrowser\n```\n\n## Usage\n\n### Browser Handler\n\nYou can decorate your function with a browserHandler. This will create the driver and properly quit it if an exception occurs or when the program ends.\n\n```python\nfrom time import sleep\nfrom fBrowser import browserHandler\n\n\n@browserHandler()\ndef main(driver):\n    driver.get('https://www.google.com')\n    sleep(5)\n\n\nmain()\n```\n\nYou can also pass in these optional arguments:\n\n```python\n@browserHandler(path='', firefox=False, proxy='\u003chost/ip\u003e:\u003cport\u003e',\n                headless=True, implicitWaitTime=60, incognito=True)\n```\n\n### New Tab\n\nRun a function in a new tab of Chrome. It will automatically close and switch contexts when it finishes executing.\n\nYou can use the `newTab` function to decorate your selenium functions. Doing so will execute your function in a new tab of the browser. Your decorated function must have its first parameter for the webdriver.\n\n```python\nfrom time import sleep\nfrom fBrowser import browserHandler, newTab\n\n\n@newTab\ndef loadTheVerge(driver):\n    driver.get('https://www.theverge.com')\n    sleep(2)\n\n\n@browserHandler()\ndef main(driver):\n    driver.get('https://www.google.com')\n    sleep(2)\n    loadTheVerge(driver)\n\n\nmain()\n```\n\n### Login\n\nUse this helper function to login into a site. Simply pass in your email / username and your password. (This function assumes that the input tags in the form have attributes @type=username, @type=email, or @type=password).\n\n```python\nimport fBrowser\nfrom fBrowser import browserHandler\n\n\n@browserHandler()\ndef main(driver):\n    driver.get(\n        'https://stackoverflow.com/users/login')\n    fBrowser.login(driver, email='testing@gmail.com', password='abc123')\n\n\nmain()\n```\n\n### Fill Inputs\n\nQuickly fill multiple inputs with either a single value or multiple values.\n\n```python\nimport fBrowser\nfrom fBrowser import browserHandler\n\n\n@browserHandler()\ndef main(driver):\n    driver.get('example.com')\n    # A list of xpaths to the inputs\n    xpaths = ['//*[@name=\"foo\"]', '//*[@name=\"bar\"]', '//@name=\"fooBar\"']\n\n    # Fill with multiple values\n    fBrowser.fillInputs(driver, xpaths, ['value1', 'value2', 'value3'])\n\n    # Or pass in one value\n    fBrowser.fillInputs(driver, xpaths, 'hello world')\n\n\nmain()\n```\n\n### Human Type\n\nDon't want to get flagged as a bot? Fill your inputs using a human-like typing speed.\n\n```python\nimport fBrowser\nfrom time import sleep\nfrom fBrowser import browserHandler\n\n\n@browserHandler()\ndef main(driver):\n    driver.get('https://www.google.com')\n    chatInput = driver.find_element_by_xpath('//*[@name=\"q\"]')\n    # Will input the string at a human-like typing speed\n    fBrowser.humanType(driver, chatInput, 'Hello world!')\n    sleep(5)\n\n\nmain()\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/FastestMolasses/fBrowser/fork\u003e)\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastestmolasses%2Ffbrowser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastestmolasses%2Ffbrowser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastestmolasses%2Ffbrowser/lists"}