Saravanan666/pypi-org huggingface dataset:
Package: selenium-datatable
selenium-datatableOverviewA small library for simplifying a table object in seleniumInstallationIf you have pip on your system, you can simply install or upgrade the Python bindings:pip install selenium-datatableAlternately, you can download the source code and run:python setup.py installUsageA table object class implementation:# -- FILE: table.pyfromselenium.webdriver.common.byimportByfromselenium_datatableimportDataTable,ColumnclassUsersTable(DataTable):rows_locator=(By.CSS_SELECTOR,"tbody > tr")headers_locator=(By.CSS_SELECTOR,"thead > tr > th")# columnslast_name=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(1)")first_name=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(2)")email=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(3)")due=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(4)")web_site=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(5)")delete_button=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(6) a[href='#delete']")edit_button=Column(By.CSS_SELECTOR,"tr:nth-of-type({row}) td:nth-of-type(6) a[href='#edit']")A page object class implementation:# -- FILE: home_page.pyfromtableimportUsersTableclassHomePage:items_list=UsersTable("id","table1")def__init__(self,driver,url='http://localhost/tables'):self.driver=driverself.url=urldefopen(self):self.driver.get(self.url)Unittest:# -- FILE: test_table.pyimportunittestfromselenium.webdriverimportChromefromhome_pageimportHomePageclassTestTable(unittest.TestCase):defsetUp(self):self.driver=Chrome()self.page=HomePage(self.driver)self.page.open()deftest_get_item_from_first_row(self):item=self.page.items_list.get_item_by_position(1)self.assertEqual(item.first_name.text,'John')self.assertEqual(item.last_name.text,'Smith')self.assertEqual(item.email.text,'jsmith@gmail.com')deftest_get_item_by_property(self):item=self.page.items_list.get_item_by_property(last_name='Doe',first_name='Jason')self.assertEqual(item.first_name.text,'Jason')self.assertEqual(item.last_name.text,'Doe')deftest_number_of_rows(self):assertlen(self.page.items_list)==4deftest_iterate_through_rows(self):forrowinself.page.items_list:self.assertTrue(hasattr(row,'last_name'))deftest_comprehension_list_slice(self):users=[rowforrowinself.page.items_list[1:3]]self.assertEqual(len(users),2)self.assertEqual(users[0].first_name.text,"Frank")self.assertEqual(users[1].first_name.text,"Jason")deftearDown(self):self.driver.close()TheDataTableclass is looking for a "driver" attribute in an owner class, but you can change that behaviour by overriding the attributedriver_attributefrom theDataTableclass.classUsersTable(DataTable):...driver_attribute="selenium"
Package: selenium-driver-updater
selenium_driver_updaterIt is a fast and convenience package that can automatically download or update Selenium webdriver binaries and their browsers for different OS.InstallationUse the package managerpipto install selenium_driver_updater.pip install selenium-driver-updaterUsage in codeThis example shows how you can use this library to download chromedriver binary and use it immediately.fromselenium_driver_updaterimportDriverUpdaterfromseleniumimportwebdriverimportosbase_dir=os.path.dirname(os.path.abspath(__file__))filename=DriverUpdater.install(path=base_dir,driver_name=DriverUpdater.chromedriver,upgrade=True,check_driver_is_up_to_date=True)driver=webdriver.Chrome(filename)driver.get('https://google.com')Or you can use library to download and update chromedriver and geckodriver binaries at the same time.fromselenium_driver_updaterimportDriverUpdaterfromseleniumimportwebdriverimportosbase_dir=os.path.dirname(os.path.abspath(__file__))list_drivers=[DriverUpdater.chromedriver,DriverUpdater.geckodriver]filenames=DriverUpdater.install(path=base_dir,driver_name=list_drivers,upgrade=True,check_driver_is_up_to_date=True)print(filenames)driver_chrome=webdriver.Chrome(filename[0])driver_chrome.get('https://google.com')driver_firefox=webdriver.Firefox(filename[1])driver_firefox.get('https://google.com')Usage with help of command lineUseselenium-driver-updater--helpTo see all available arguments and commandsThis example shows how you can use this console updater to download chromedriver to current dirselenium-driver-updater-dchromedriverOr you can use console updater to download chromedriver and geckodriver at the same timeselenium-driver-updater-dchromedriver,geckodriverSupported Selenium BinariesChromedriverDriverUpdater.chromedriverFor installing or updatingchromedriver binaryAll supported OS for this driver are:WindowsLinuxMacOSMacOS with M1GeckodriverDriverUpdater.geckodriverFor installing or updatinggeckodriver binaryAll supported OS's for this driver are:WindowsWindows ARMLinuxLinux ARMMacOSMacOS with M1OperadriverDriverUpdater.operadriverFor installing or updatingoperadriver binaryAll supported OS's for this driver are:WindowsLinuxMacOSEdgedriverDriverUpdater.edgedriverFor installing or updatingedgedriver binaryAll supported OS's for this driver are:WindowsWindows ARMMacOSMacOS with M1LinuxPhantomJSDriverUpdater.phantomjsFor installing or updatingphantomjs binaryAll supported OS's for this driver are:WindowsMacOSLinuxSafariDriverDriverUpdater.safaridriverFor installing or updatingsafaridriver binaryAll supported OS's for this driver are:MacOSSupported browsers for updatesChrome BrowserFor updatingchrome browserAll supported OS's for this browser are:MacOSFirefox BrowserFor updatingfirefox browserAll supported OS's for this browser are:MacOSOpera BrowserFor updatingopera browserAll supported OS's for this browser are:Windows 32 / 64 / ARMMacOSEdge BrowserFor updatingedge browserAll supported OS's for this browser are:MacOS
Package: selenium-elements
Page object model made easy.Free software: BSD 2-Clause LicenseInstallationpip install selenium-elementsDocumentationTo use the project:fromcontextlibimportcontextmanagerimportpytestfromseleniumimportwebdriverfromselenium.webdriver.common.byimportByfromselenium.webdriver.support.expected_conditionsimportstaleness_offromselenium.webdriver.support.waitimportWebDriverWaitfromselenium_elements.conditionsimportclickablefromselenium_elements.elementsimportPageElement,PageElements,RegionElementsfromselenium_elements.pageimportPage,Regionfromselenium_elements.validatorsimporttitle_matches,url_contains@contextmanagerdefwait_for_page_load(driver,timeout=30):old_page=driver.find_element_by_tag_name("html")yieldWebDriverWait(driver,timeout).until(staleness_of(old_page))classShow(Page):path="/show/{show_slug}/"validators=[title_matches("^[a-zA-Z]+ | PBS$"),url_contains("pbs.org/")]official_website_btn=PageElement(By.CLASS_NAME,"btn--visit",condition=clickable)@propertydefofficial_website_link(self):returnself.official_website_btn.get_attribute("href")classPromoShowRegion(Region):title_element=PageElement(By.CLASS_NAME,"carousel--show-strip__image-link")defopen(self):withwait_for_page_load(self.driver):self.title_element.click()returnShow(driver=self.driver,base_url=self.base_url,visit=False)deftitle(self):returnself.title_element.get_attribute("data-gtm-label")classHome(Page):path="/"load_timeout=30validators=[title_matches("^PBS: Public Broadcasting Service$"),url_contains("pbs.org/"),]promo_show_elements=PageElements(By.CLASS_NAME,"show-promo",find_on_page_load=True)promo_shows=RegionElements(region_class=PromoShowRegion,root_element=promo_show_elements)@pytest.fixturedefdriver():driver=webdriver.Chrome()yielddriverdriver.quit()deftest_foo(driver):home=Home(driver=driver,base_url="https://www.pbs.org")forshowinhome.promo_shows:print(show.title())show=home.promo_shows[0].open()print(show.official_website_link)assertTrue
Package: selenium-enhancer
Installationpip install selenium-enhancerSetting Up a DriverAfter installing or whenver you need to update to the latest version of
ChromeDriver, run:python -m selenium_enhancer.get_latest_chrome_driverChromeDriveris recommended as it has
more options, but Firefox and IE drivers are in theory compatible as well.
Please feel free to contribute if you need additional functionality.Getting Startedfromselenium_enhancerimportSeleniumEnhancerclassClassName(SeleniumEnhancer):defcomplete_web_form(self):self.start_chrome_driver()self.driver.get("full-url-of-page-with-form.com")self.set_input_elements({"id or CSS selector or XPath":"value I want to set","second id or CSS selector or XPath":"second value"})self.set_select_elements({"name or id of select element":"partial/complete text of option"})self.click_button("submitButtonId")driver=ClassName()driver.complete_web_form()ExamplesIf you're cloning the repo to contribute, you can run/view/add to the tests
with atpytest tests -s -vv.MiscellaneousPyPi
Package: selenium-fetch
selenium-fetchA simple module that lets you access thefetchAPI with selenium!Why do I make this? just annoyed with cloudflare. It works best withundetected-chromedriver.Installationpip install selenium-fetch undetected-chromedriverExamplefromundetected_chromedriverimportChromefromselenium_fetchimportfetch,Options,get_browser_user_agentLOGIN_PAGE_URL="https://smekdong.com/login"LOGIN_API_URL="https://smekdong.com/api/login"driver=Chrome(headless=False)driver.get(LOGIN_PAGE_URL)post_data={'username':'blaabla','password':'xxxx'}headers={"user-agent":get_browser_user_agent(driver),'origin':'https://smekdong.com','referer':'https://smekdong.com/',}options=Options(method="POST",headers=headers,body=post_data)response=fetch(driver,LOGIN_API_URL,options)print("Response:",response)
Package: selenium-findtext
Selenium Text Finding UtilitiesMake your tests user-first by using these utilities to test against the
presented content on the page, not the implementation detail of specific
markup.Find Elements by TextThe most powerful utilities arefind_element_by_text(driver, text)andfind_elements_by_text(driver, text), which search the page for one or
multiple elements with content matching the given text, as efficiently as
possible. By default, the inner text must match exactly.Call with the flagexact=Falseto find elements which simplycontainthe text.For example::# Find the logout element and click it, whatever it might befindtext.find_element_by_text(driver,'Logout').click()Form HelpersYou can locate and interact with form elements based on their labels, the
way a user would find things on the page and the way your features are most
likely to be documented.fill_input_by_label(driver, element, label, value, timeout=None):Interact with text fields on the page based on their visible label. Here is
how you might fill in a login form:fill_input_by_label(driver,None,"Username",username)fill_input_by_label(driver,None,"Password",username)Notice how you don't need to know anything about the markup on the page, the
ID of the input elements, or if the label text is "Username" or
"Username:".If you only want to look at a part of the page, not the whole page, you can
pass an optional element as the second parameter. The search will be done
to descendents under that element.fill_input_by_placeholder(driver, element, label, value):You might also know youb can locate an element based on the placeholder text
that can be read in the input. This function is called just like the previous
function.read_input_by_label(driver, element, label):You can use the same logic to read information back out of forms, too.assertexpected==read_input_by_label(driver,None,"State")
Package: selenium-firefox
selenium_firefoxDescriptionUser-friendly implementation of a firefox based selenium clientFeaturesEasily create a firefox selenium webdriver with proxy(host/port), extensions and other settings, such as, full-screen-window,
private session.Override user-agentEasily save and load cookies for websitesInstallpipinstallselenium_firefox# orpip3installselenium_firefoxUsagefromselenium_firefoximportFirefoxff=Firefox()ff.get('https://www.google.com')importtimetime.sleep(999)Dependenciesgeckodriver-autoinstaller,kproxy,noraise,selenium,selenium-browser,setuptools
Package: selenium-form-killer
Selenium KillerIntroduçãoO Selenium Killer é uma biblioteca que permite usar o httpx para realizar requisições e capturar os dados de um site. Assim você pode usar a biblioteca para automatizar tarefas como:Capturar os dados de um siteRealizar requisições POSTRealizar requisições GETEnviar formuláriosEle surge como uma necessidade de automação, pois abrir navegador é um processo caro e demorado.O Selenium Killer não tem renderização por javascript. Logo para tarefas que exigem interação por javascript, você deve usar o Selenium ou alguma biblioteca parecida.Como UsarO coração do Selenium Killer é a classeSeleniumKillerque contém as funçõesget,posteforms.ExemplosImportar e instanciarfromselenium_killer.killerimportSeleniumKillerkiller=SeleniumKiller()A selenium killer é baseada no padrão factory pattern. Sempre retornando uma nova instancia do mesmo objeto.Exemplo de usokiller=SeleniumKiller()killer.get('https://google.com')killer.formskiller.post('https://google.com')UsoVamos fazer um requisição para o sitehttps://google.come capturar os dados de um formulário:killer=SeleniumKiller()awaitkiller.get('https://google.com')forms=killer.formsforms[0].submit()forms[0].fields
Package: selenium-generator
Selenium_generatoris a framework for automated generating of automated functional tests of web applications
from test scenarios written in yaml format, based on Selenium WebDriver framework.Framework provides easy way for writing scenarios in human readable format which is easier to maintain in comparison
with clear code. It also support many of the most used best practices and patterns.Framework is designed to be easily extensible.Link to oficial documentation.FeaturesAutomated generation of Tests based on Scenarios in yaml formatData Driven Testing (DDT)Page Factory design patternSpecification of Test suitesWebDriver managerTest report generatingTaking screenshots on failureIncluding screenshots in test reportEasy configurationConfigure everything what is needed for test execution from one place.scenarios:"scenarios"data:"data"pages:"pages"report:screenshots:trueclean:trueparams:output:"reports"combine_reports:truereport_name:"TestReport"report_title:"MyReport"tags:["acceptance","regression"]drivers:chrome:remote:falsefirefox:remote:falseCopyright NoticeCerberus is an open source project by Jakub Jaros. See the originalLICENSEfor more
information.
Package: selenium-geocoder
selenium-geocoderModularizing selenium code for getting coordinates from address of a place.Example:fromselenium_geocoderimportGlobe,Browsers# code for selecting browser to automate on:globe=Globe(browser=Browsers.FIREFOX)"""Supported browsers:- Mozilla Firefox- Google Chrome- Microsoft Edge"""# code to get coordinates of a single locaiton: (returns a tuple)x,y=globe.get_coordinate(name='University of Mumbai')# code to get coordinates of a batch of locations: (returns a list)coordinates=globe.get_coordinates(name=['Grand Hyatt Mumbai','Tajlands Mumbai','Trident Mumbai'])
Package: seleniumGoogleLogin
Author:KuoYuan Liauto login google account by selenium chrome driverinstallation NoteNeed selenium 4(above) and webdriver_manager to get the chromedriver automatically.
if the version is not correction , please uninstall the selenium and install again.Sample codeimport seleniumGoogleLogin
from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))
email = "your g-mail"
password = "your password"
if seleniumGoogleLogin.start(driver,email, password):print('ok')LicenseMIT
Package: selenium-helpers
selenium_helpersWhat is it?Helpful utilities and wrappers for Selenium work.There are two key utilities in here -ClickUsed to resolve issues caused while clicking an element.
Very often, elements are overlayed in such a way that a click isn't as simple as it should be.This addresses that; simple call it with -click(driver,element)Wait UntilAllows you to wait until some condition is met.The following conditions are supported -Title IsTitle ContainsURL MatchesURL IsURL ContainsYou FindYou Find AllYou Find TextYou Find Button TextYou Find All TextYou Find PlaceholderYou Don't Findwait_until(driver,'title is','Google')
Package: selenium-interceptor
Selenium-InterceptorModifying oradding headersModify responseFeel free to test my code!Getting StartedDependenciesPython >= 3.7Chrome-BrowserinstalledSeleniumInstalling[Windows] InstallChrome-Browserpip install selenium_interceptorChange-headersfromselenium_interceptor.interceptorimportcdp_listenerfromselenium_profilesimportdriverasmydriverfromselenium_profiles.profilesimportprofilesmydriver=mydriver()profile=profiles.Windows()driver=mydriver.start(profile)cdp_listener=cdp_listener(driver=driver)cdp_listener.specify_headers({"sec-ch-ua-platform":"Android"})thread=cdp_listener.start_threaded(listener={"listener":cdp_listener.requests,"at_event":cdp_listener.modify_headers})driver.get("https://modheader.com/headers?product=ModHeader")Don't forget to executecdp_listener.terminate_all()in the End. Else-wise your temporary folder will get flooded! (Windows) and it keeps runningHelpPlease feel free to open an issue or fork!TodoDeprecatedAuthorsAurin AegerterLicenseShield:This work is licensed under aCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.DisclaimerI am not responsible what you use the code for!!! Also no warranty!AcknowledgmentsInspiration, code snippets, etc.Selenium-ProfilesChrome-devtools-protocolcdp_event_listeners
Package: selenium-kit
Selenium KitSelenium toolkit to download the selenium drivers automatically and to use the selenium drivers with all the necessary functions.Sample Code# Import selenium driversfromseleniumKitimportSeleniumDriver# Create the selenium objectselenium=SeleniumDriver()# Call the urlurl="https://www.imdb.com/"selenium.callURL(url)# Write on the search text fieldxpath="input[@id='suggestion-search']"element=selenium.elementByXPath(xpath)selenium.sendKeys(element,preference)# Click on the first search resultxpath="div[@class='sc-idXgbr iHkrUj searchform__inputContainer']/div/div/div/ul/li"movie_search_result=selenium.elementsByXPath(xpath)sleep(0.5)selenium.clickOnElement(movie_search_result[0])# Delete the selenium driverdelselenium
Package: selenium-leo
# Este modulo contiene funciones Ãºtiles para trabajar con selenium en python“””Funciones:send_key_as_human: Envia una cadena de texto una a una con un tiempo random entre 0.15 a 0.40 segundosdoble_selector_xpath: Se le pasa 2 direcciÃ³n de selectores y el tiempo de espera, si el primero falla usa el segundo.y otros mas de doble selector…
“””
Package: selenium-library
Module selenium_librarySub-modulesselenium_library.baseClassesBase(browser='chrome', headless=True, window_width=1920, window_height=1080):   Base seleniumExample:
    from selenium_library import Base

    session = Base(headless=False)
    session.open('https://www.google.de')
    input = session.element('[name="q"]')
    session.click(input)
    session.send_keys(input, 'pipi')

Init session vars

Args:
browser (str): Browser name
headlesss (boolean): Hide browser
window_width (int): Window width
window_height (int): Window height

### Methods

`clear_keys(self, selector_or_element)`
:   Clear keys from element

    Args:
        selector_or_element [str, WebElement]

`click(self, selector_or_element)`
:   Try to click on an element

    Args:
        selector_or_element [str, WebElement]

`close(self)`
:   Close the current session

`element(self, selector)`
:   Try to find an element in dom

    Returns [None]: Element or None

`elements(self, selector)`
:   Try to find every element in dom
        If there is no element it returns None

    Args:
        selector (str): DOM selector


    Returns [None, list]: List of elements or None

`get_url(self)`
:   Get the current url from the session

    Returns (str): Current url

`launch_browser(self)`
:   Launch browser and create a session

`open(self, url)`
:   Open a new url in the session

`send_keys(self, selector_or_element, keys)`
:   Send keys to an element

    Args:
        selector_or_element [str, WebElement]
        keys (str): Keys to send

`wait(self, time=1, is_random=False, min=1, max=10)`
:   Wait a specific time or random

    Args:
        time (int): Time to stop script
        is_random (boolean): Waits a random time if true
        min (int): Minium time to wait if random
        max (int): Max time to wait if random
Package: selenium-linux
selenium_linux
Python language bindings for Selenium WebDriver.The selenium package is used to automate web browser interaction from Python.Home:http://www.seleniumhq.orgDocs:   selenium package API
Dev:https://github.com/SeleniumHQ/SeleniumPyPI:https://pypi.org/project/selenium/IRC:    #selenium channel on freenode
Several browsers/drivers are supported (Firefox, Chrome, Internet Explorer), as well as the Remote protocol.
Package: selenium_loader
Selenium LoaderA simple way to define your route to automate task withSeleniumvia descriptiveYMLconfiguration.Explore the docs »View Demo·Report Bug·Request FeatureAbout The ProjectA simple way to declarate explicitly the steps to automate a task with Selenium, using a YML configuration file.
You just need to define the steps to automate a task, and the Selenium Loader will do the rest.Built withGetting StartedPrerequisitesInstallationLicenseDistributed under the MIT License. SeeLICENSE.txtfile for more information.
See more about this inApache License, Version 2.0.
Package: selenium-logging
Explanation on youtube:https://www.youtube.com/watch?v=b5XPHqWT94sLogging of screenshot and messages to HTML file. Can be used with selenium, but not necessary.
How to use it:from LoggingSelenium.LogHTML import LogHTMLLogHTML.set_log_path(r"C:\pathToFolderForLogs")
LogHTML.set_logging_level(LogHTML.INFO, use_screenshot=True)LogHTML.screenshot("Screenshot is taken")
LogHTML.debug("Random message")
LogHTML.info("Random message")Logging levels:
-debug
-info
-warning
-error
-critical
Package: selenium-move-cursor
SeleniumMoveCursorMoving cursor to element in browser run by selenium webdriver.
Works for chrome and firefox browser maximized or minimized. Method to use is move_to_element.PreconditionsWeb element is visible on browser (scroll should be done before calling method move_to_element)Parameters for method move_to_elementdriver - WebDriverelement - WebElementdisplay_scaling - Display scaling (100, 125, 150 or 175 %) need to be given when calling method move_to_element.
Default is 100.
This info can be found in display settings.chrome_info_bar_shown - Is shown chrome infobar with text: "Chrome is being controlled by automated test software"How to use method for moving cursor to web element (move_to_element):from selenium import webdriver
from selenium_move_cursor.MouseActions import move_to_element_chromedriver = webdriver.Chrome(chrome_options=chrome_options)driver.maximize_window()driver.get("https://www.google.com/")
element = driver.find_elements_by_css_selector("input[class='gNO89b']")[1]move_to_element_chrome(driver, element, display_scaling=100, chrome_info_bar_shown=True)
Package: selenium-odoo-pages
Selenium odoo pagesA set of pages and elements used to interact with odoo
pages and widgets using thepage selenium objectspattern.UsageThis library provides set of common tools using Selenium
to interact with odoo web pages. It was written to write
Behavior-Driven Development tests but can be used without
Gherkin language as described bellow.To learn about Gherkin language you may start withpytest-bdd documentationthe recommended tools to launch your tests.Theexample directorycontains examples of
usages that are also used to test this library.Rules of thumb to make scenario easier to maintainsscenario should be as short as possiblea scenario should focus to one thingpreparing data should be as fast as possible using available
shortcut (xmlrpc, database access...)ContributingThe idea of this librairy is t