Saravanan666/pypi-org huggingface dataset:
Package: selenium-page-elements
# Selenium Page Elements[![Build Status](https://travis-ci.org/jenterkin/selenium-page-elements.svg?branch=master)](https://travis-ci.org/jenterkin/selenium-page-elements)[![codecov](https://codecov.io/gh/jenterkin/selenium-page-elements/branch/master/graph/badge.svg)](https://codecov.io/gh/jenterkin/selenium-page-elements)[![PyPI version](https://badge.fury.io/py/selenium-page-elements.svg)](https://badge.fury.io/py/selenium-page-elements)## Installation```$ pip install selenium-page-elements```## OverviewSelenium Page Elements is a thin wrapper around the Selenium python library that aims to make Page Objects quick and easy to create and maintain by allowing you to define and interact with web elements like object attributes.```python# Page Objectfrom selenium.webdriver.common.by import Byfrom page_elements import Element, InputField, CheckBoxclass LoginPage:url = "http://localhost/login"# Define your elements in your class.username = InputField(By.ID, 'username')password = InputField(By.ID, 'password')stay_signed_in = CheckBox(By.ID, 'stay-signed-in')login_button = Element(By.XPATH, '//button[contains(text(), "Login")]')def __init__(self, driver):# Ensure that your page object has a Selenium webdriver in `self.driver`.self.driver = driverdef open(self):self.driver.get(LoginPage.url)def login(self, username, password, stay_signed_in=True):# Use your elements just as you would any Python variable.self.username = usernameself.password = passwordself.keep_me_signed_in = stay_signed_inself.login_button.click()```The element classes take in a Selenium `By` object and a selector, so you can select any element you would be able to with Selenium.To check the value of an element simply call the element with `.value()````pythonlogin_page = LoginPage(driver)login_page.username = 'mmario'print(login_page.username.value()) # prints 'mmario'```The reason you have to call `.value()` on the element is because Selenium Page Elements simply returns a monkey-patched Selenium `WebElement` instance. The reason for returning the monkey-patched instance is to give you the flexibility that the Selenium library already gives you, while giving you a shortcut for giving you what you want most of the time. For instance, you can check to make sure that an element is visible and then get the value.```pythonassert login_page.username.is_displayed()assert login_page.username.value() == 'mmario'```
Package: selenium-page-factory
A Page Factory is one way of implementing a Page Object Model. In order to support the Page Object pattern.
As in Java we are using @findBy, here we are declaring all web element in dictionary.
Dictionary keys become WebElement or class member variable with having all extended WebElement methods.Main FeaturesInitialise all the webElements declared in Point at a time.All WebElements methods are re-define to add extra features eg- click method extended to have explicit wait for element to be clickable.Cent percent unittest coverage.Added Selenium 4 support for ActionChains methodsRaised custom Page factory exceptionsInstallationpipinstallselenium-page-factoryPre-RequisiteEvery Page in Page Object Model should have WebDriver object as class member
as shown belowclassPageClass(PageFactory):def__init__(self,driver):self.driver=driver# Requiredself.timeout=15#(Optional - Customise your explicit wait for every webElement,Default 10sec)self.highlight=True#(Optional - To highlight every webElement in PageClass)self.mobile_test=False#(Optional - Added for Appium support)Extended WebElements Methodsset_textget_textclear_textclick_buttondouble_clickget_list_item_countselect_element_by_textselect_element_by_indexselect_element_by_valueget_all_list_itemget_list_selected_itemhighlightis_Enabledis_CheckedgetAttributehovervisibility_of_element_locatedinvisibility_of_element_locatedelement_to_be_clickabletext_to_be_present_in_elementcontext_clickexecute_scriptclick_and_holdreleaseNote:
Every WebElement will be created after verifying it's Presence and visibility on Page at Run-Time.Project Pagehttps://github.com/NayakwadiS/selenium-page-factoryDocumentationhttps://selenium-page-factory.readthedocs.io
Package: selenium-pagefactory-impl
selenium-pagefactory-implA Selenium Page Factory implementation for Python, providing enhanced functionality for web automation.FeaturesSimplified and intelligent page factory for Selenium projects.Convenient methods for interacting with web elements.Improved handling of StaleElementReferenceException.InstallationUsePoetryto install the package and its dependencies:poetryinstallHow to implement in the test# Import the PageFactory classfromselenium_pagefactory.page_factory_implimportPageFactory# Your page class using PageFactoryclassYourPageClass:# Define locatorslocators={'element_name':(By.XPATH,"//your/xpath"),# Add more locators as needed}# Initialize elements using PageFactorydef__init__(self,driver):self.driver=driverPageFactory.initialize_elements(self,driver)# Example usagedriver=webdriver.Chrome()page_instance=YourPageClass(driver)page_instance.element_name.click()LicenseThis project is licensed under the MIT License - see the LICENSE file for details.AcknowledgmentsSpecial thanks to the Selenium and pytest communities.
Package: selenium-page-objects
### selenium-page-objects基于 selenium 的 Page objects 设计模式测试库。#### Installation------------download install:```shell$ python setup.py install```pip install:```$ pip install -i https://test.pypi.org/simple/ selenium-page-objects```#### 使用文档：请阅读 [wiki](https://github.com/defnngj/selenium_page_objects/wiki)#### 项目历史：原项目：https://github.com/eeaston/page-objects原项目已经不再维护，我阅读了原项目代码，虽然只有100多行，但设计非常精妙。本项目在此基础上进行开发。
Package: selenium-peacemaker
Package🐍   selenium_peacemakerDescriptionStealth emulate and automate Chrome using profiles, proxy and selenium.Exampleimport selenium_peacemaker as sp
from time import sleep

selenium = sp.Stealth(mobile=False)
driver = selenium.stealth()
driver.get('https://www.google.com')
sleep(90)
driver.close()Status🚀   This Project is in it's early stages of Development.📌   Still working on new features.Contact⚠️  Any questions or suggestions please message me onTelegram.Version🖥   Alpha: 1.0.0CreditskaliiiiiiiiiiSelenium-Profilesdiprajpatraselenium-stealthultrafunkamsterdamundetected_chromedriverLicenseShield:This work is licensed under aCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.Please read the license file.Copyright (c) 2023 Hack Napier.DisclaimerI am not responsible what you use the code for!!! Also no warranty!
Package: selenium-pinterest
selenium_pinterestInstallpipinstall--upgradeselenium-pinterest# orpip3install--upgradeselenium-pinterestUsagefromselenium_pinterestimportPinterestpinterest_demo=pinterst_one=Pinterest("/path/to/cookies","path/to/extension",host='host_nr',port=12345)pinterest_demo.repin('pin_id')## Dependenciesgeckodriver
Package: selenium-po
Selenium的PO模型封装使用Yaml文件进行元素信息的管理安装Github地址：https://github.com/zx490336534/selenium-po$pipinstallselenium-po使用方法创建一份yaml代码中使用的是name后的内容，实际页面元素定位使用的value中的内容，方便后续统一维护pages:-page:pageName:indexdesc:首页locators:-{desc:"搜索栏",type:"id",value:"kw",timeout:3,name:"index_input"}-{desc:"查询按钮",type:"id",value:"su",timeout:3,name:"index_search"}-page:pageName:newsdesc:新闻locators:-{desc:"搜索栏",type:"id",value:"ww",timeout:3,name:"news_input"}-{desc:"查询按钮",type:"id",value:"s_btn_wr",timeout:3,name:"news_search"}创建一个页面操作对象importosimporttimefromselenium_po.elementoperatorimportElementOperatorpath=os.path.dirname(os.path.abspath(__file__))classBaiDuIndexAction(ElementOperator):def__init__(self,path=f"{path}/pages.yaml",file_name='index',driver=None):super(BaiDuIndexAction,self).__init__(path,file_name,driver)self.url='http://www.baidu.com'classBaiDuNewsAction(ElementOperator):def__init__(self,path=f"{path}/pages.yaml",file_name='news',driver=None):super(BaiDuNewsAction,self).__init__(path,file_name,driver)self.url='http://news.baidu.com/'测试if__name__=='__main__':baidu=BaiDuIndexAction()baidu.open(baidu.url,baidu.index_input)baidu.input(baidu.index_input,"python")baidu.click(baidu.index_search)time.sleep(2)baidu.screenshot_pic("1.png")# baidu.close()baidu_news=BaiDuNewsAction(driver=baidu.driver)baidu_news.open(baidu_news.url,baidu_news.news_input)baidu_news.input(baidu_news.news_input,"python新闻")baidu_news.click(baidu_news.news_search)time.sleep(2)baidu_news.screenshot_pic("2.png")baidu_news.close()输出往「首页_搜索栏」输入「python」
点击「首页_查询按钮」
往「新闻_搜索栏」输入「python新闻」
点击「新闻_查询按钮」截图公众号：「测试游记」
Package: selenium-probes
SeleniumProbesSeleniumProbesis a library of building blocks to construct probes generating metrics for automated testing of web app performance and availability like accessing a login page, authenticating on it and then triggering some functionality by clicking on a web element.Getting StartedFollow these instructions to use the package in your project.InstallingSeleniumProbeslibrary could be added to your project by installing it from the Python Package Index (PyPI) repository. Run the following command to:install a specific versionpipinstall"selenium_probes==0.1"install the latest versionpipinstall"selenium_probes"upgrade to the latest versionpipinstall--upgrade"selenium_probes"install optional dependencies like Microsoft Azure libraries to use KeyVault helper to work (not everybody would need that, hence it is an optional dependency)pipinstall"selenium_probes[keyvault]"RequirementsPyPI packages:Python >= 3.6selenium >= 3.141.0DeploymentThis library package is not intended for stand-alone deployment. It should be used as part of some webapp-specific probe. SeeSeleniumBottleproject as an example.Built usingSelenium WebDriver- Web browser interactionsVersioningWe useSemantic Versioning Specificationas a version numbering convention.Release HistoryFor the available versions, see thetags on this repository. Specific changes for each version are documented inCHANGES.md.Also, conventions forgit commitmessages are documented inCONTRIBUTING.md.AuthorsOleksiy Kuzmenko-OK-UNDP@GitHub-Initial workAcknowledgmentsHat tip to anyone helping.LicenseUnless otherwise stated, all authors (see commit logs) release their work under theMIT License. SeeLICENSE.mdfor details.ContributingThere are plenty of ways you could contribute to this project. Feel free to:submit bug reports and feature requestsoutline, fix and expand documentationpeer-review bug reports and pull requestsimplement new features or fix bugsSeeCONTRIBUTING.mdfor details on code formatting, linting and testing frameworks used by this project.
Package: selenium-recaptcha
A package that allows to solve reCaptcha v2 with selenium.Simple Example:from selenium import webdriver
from selenium_recaptcha import Recaptcha_Solverdriver = webdriver.Chrome()
driver.get('https://www.google.com/recaptcha/api2/demo')solver = Recaptcha_Solver(
driver=driver, # Your Web Driver
ffmpeg_path='', # Optional. If does not exists, it will automatically download.
log=1 # If you want to view the progress.
)
solver.solve_recaptcha()
Package: selenium-recaptcha-solver
Selenium-recaptcha-solverYou can use this package to solve ReCAPTCHA challenges with selenium.It supports single-step and multi-step audio solving for ReCAPTCHA V2 with >90% success rate.Please use this package responsibly and for non-exploitative ends.RequirementsPython 3.7+Main dependencies:SpeechRecognition python package to transcribe speechPydub for file conversionsRequests for HTTP requestsSelenium for web driverIf you're getting an error related to FFmpeg not being installed or in your PATH, get it here:https://ffmpeg.org/download.htmlIf the error persists, make sure FFmpeg is properly installed for your OS and in your PATH.Installationpython-mpipinstallselenium-recaptcha-solverUsage example with ReCAPTCHA demo sitefromselenium_recaptcha_solverimportRecaptchaSolverfromselenium.webdriver.common.byimportByfromseleniumimportwebdriverfromselenium.webdriver.chrome.optionsimportOptionstest_ua='Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36'options=Options()options.add_argument("--headless")# Remove this if you want to see the browser (Headless makes the chromedriver not have a GUI)options.add_argument("--window-size=1920,1080")options.add_argument(f'--user-agent={test_ua}')options.add_argument('--no-sandbox')options.add_argument("--disable-extensions")test_driver=webdriver.Chrome(options=options)solver=RecaptchaSolver(driver=test_driver)test_driver.get('https://www.google.com/recaptcha/api2/demo')recaptcha_iframe=test_driver.find_element(By.XPATH,'//iframe[@title="reCAPTCHA"]')solver.click_recaptcha_v2(iframe=recaptcha_iframe)You can check a detailed use case in the tests folder of this project (Its execution is shown below in the demonstration chapter).DemonstrationAvoiding detectionTo decrease your chances of ReCAPTCHA detecting automated queries, try the following:Use a custom user-agent header (Make sure it's not a headless user-agent!)Use a hard-to-detect web driverUse proxies to avoid IP blacklistingAn example of a good user-agent: Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36An example of a bad user-agent: are Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/92.0.4512.0 Safari/537.36Note the last part of the user-agent; the headless specification is usually there.QuestionsIf the documentation hasn't covered something, or you have questions about how to use the package or how it works, please reach out.
Package: selenium-requests
Selenium RequestsExtends Selenium WebDriver classes to include therequestfunction from theRequestslibrary, while doing all the needed cookie and request headers handling.Before the actual request is made, a local HTTP server is started that serves a single request made by the webdriver
instance to get the "standard" HTTP request headers sent by this webdriver; these are cached (only happens once during
its lifetime) and later used in conjunction with the Requests library to make the requests look identical to those that
would have been sent by the webdriver. Cookies held by the webdriver instance are added to the request headers and those
returned in a response automatically set for the webdriver instance.FeaturesDetermines and sends the default HTTP headers (User-Agent etc.) for the chosen WebDriverManages cookies bidirectionally between requests and SeleniumSwitches to already existing window handles or temporarily creates them to work with the webdriver's cookies when
making a requestAll operations preserve the original state of the WebDriver (active window handle and window handles)Tested to work with Selenium (v4.1.0) using Mozilla Firefox (v97.0) and Chromium (v98.0.4758.80)Usage# Import any WebDriver class that you would usually import from# selenium.webdriver from the seleniumrequests modulefromseleniumrequestsimportFirefox# Simple usage with built-in WebDrivers:webdriver=Firefox()response=webdriver.request('GET','https://www.google.com/')print(response)# More complex usage, using a WebDriver from another Selenium-related module:fromseleniumrequests.requestimportRequestsSessionMixinfromsomeothermoduleimportCustomWebDriverclassMyCustomWebDriver(RequestsSessionMixin,CustomWebDriver):passcustom_webdriver=MyCustomWebDriver()response=custom_webdriver.request('GET','https://www.google.com/')print(response)Installationpip install selenium-requestsRemote WebDriverWhen usingwebdriver.Remoteit is very likely that the HTTP proxy server spawned byselenium-requestsdoes not run
on the same machine. By default, the webdriver tries to access the proxy server under127.0.0.1. This can be changed
by passing theproxy_host=argument with the correct IP or hostname to the webdriver.driver=seleniumrequests.Remote('http://192.168.101.1:4444/wd/hub',options=chrome_options,proxy_host='192.168.101.2')
Package: selenium-requests-html
Selenium Requests HTML=================Extends Selenium WebDriver classes to include the [HTMLSession](http://html.python-requests.org/) from the [Requests-HTML](http://html.python-requests.org/) library, while doing all the needed cookie and request headers handling.This hasn't really been tested and is not likely to get a whole lot of work done on it. My initial tests seemed to work for my use case. Most functionality worked with another webdriver, but the render function in Requests-HTML has a dependency that uses chromedriver and I have not yet looked into a way around it.Most of the work already seemed to have been done, thanks to the organization and work already done in [Selenium Requests](https://github.com/cryzed/Selenium-Requests) and [Requests-HTML](http://html.python-requests.org/), as well as the original [Requests](http://python-requests.org/) library.Usage-----```python# Import any WebDriver class that you would usually import from# selenium.webdriver from the seleniumrequestshtml modulefrom seleniumrequestshtml import Chromefrom selenium.webdriver.chrome.options import Options# Set up the options for your webdriverurl = 'https://illsea.com'options = Options()options.add_argument("--headless")webdriver = Chrome(chrome_options=options)# webdriver.requests_session replaces regular HTMLSession() usage from requests-htmlsession = webdriver.requests_session# then just do requests-HTML thingsresponse = session.get(url)images = response.html.find('img')print(images)
Package: selenium-session-client
Python clientThe Python Selenium Session Client (SSC) integrates into your tests, retrieves the session information from the Selenium Session Server and applies the session cookies into the running selenium browser.Note that support to the Selenium Session Manager and its components is available at the BlinqIO forum:https://community.blinq.io/.Following is a code example to integrate it into your Python Selenium tests:importosfromtimeimportsleepfromseleniumimportwebdriverfromselenium.webdriver.chrome.serviceimportServicefromselenium_session_client.session_clientimportinit_sessiondeftest():driver=webdriver.Chrome('chromedriver')init_session(driver,['github'])driver.get("https://github.com/")sleep(5)driver.quit()test()To add the dependencies into your project:PIPpipinstallselenium-session-client
Package: selenium_setup
selenium_setupinstallpipinstallselenium_setupCLIdownload default version driver and unzip to CWDselenium_setup# or: python3 -m selenium_setupchrome ver = '104.0.5112.79'linux64downloading to: /path/to/chromedriver_linux64--104.0.5112.79.zip100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.1/7.1 MB 200.8 kB/slist 10 links of some latest versionsselenium_setup--listchrome linux64:105.0.5195.19  https://chromedriver.storage.googleapis.com/105.0.5195.19/chromedriver_linux64.zip104.0.5112.79  https://chromedriver.storage.googleapis.com/104.0.5112.79/chromedriver_linux64.zip103.0.5060.134 https://chromedriver.storage.googleapis.com/103.0.5060.134/chromedriver_linux64.zip102.0.5005.61  https://chromedriver.storage.googleapis.com/102.0.5005.61/chromedriver_linux64.zip101.0.4951.41  https://chromedriver.storage.googleapis.com/101.0.4951.41/chromedriver_linux64.zip100.0.4896.60  https://chromedriver.storage.googleapis.com/100.0.4896.60/chromedriver_linux64.zip99.0.4844.51   https://chromedriver.storage.googleapis.com/99.0.4844.51/chromedriver_linux64.zip98.0.4758.102  https://chromedriver.storage.googleapis.com/98.0.4758.102/chromedriver_linux64.zip97.0.4692.71   https://chromedriver.storage.googleapis.com/97.0.4692.71/chromedriver_linux64.zip96.0.4664.45   https://chromedriver.storage.googleapis.com/96.0.4664.45/chromedriver_linux64.zipdownload specific versionselenium_setup--ver...
Package: selenium-shortcuts
selenium-shortcutsShortcut functions for Python seleniumInstallation:pip install selenium-shortcutsUsage:from selenium_shortcuts import setup_shortcuts

helper = setup_shortcuts(browser='uc') # Start a browser on port 9222 or reconnect to existing browser on port 9222 with undetected-chromedriver
driver, find, finds, click, text, send, get, check = helper.driver, helper.find, helper.finds, helper.click, helper.text, helper.send, helper.get, helper.check

info = text('#info')
print(info)

click('#submit')

info = find('#info')
print(info.text)
info.click()

items = finds('.items')
for item in items:
	print(item.text)

info, classes = find('#info', attribute='class')
print(classes)
Package: selenium-simplification
selenium_simplificationGitHub|PyPIThis is not the final documentation.Make Selenium simple. Using Selenium in a pythonic style without having to google how to do non-trivial stuff.Currently implemented:driver for Chrome as SeleniumChromeeasy access to some configurations for Chrome - change the following for hopefully rather obvious effects:headlesskeep_alivelog_level_3mutedstart_maximizedwindow_positionwindow_sizeprofilelog_capabilitiespage_load_strategyextensionsuser_agenta ton of functions with tasks you might want to perform if you hadn't to google them for half an hourget_titelget_linksget_header_h1get_current_scroll_positionget_current_scroll_position_of_webelementget_all_attributes_seleniumget_all_attributes_bs4get_all_attributesget_parent_of_elementhighlightperma_highlightundo_highlightget_max_body_scroll_heightopen_new_tabopen_new_windowscroll_in_webelementscroll_altscrollscroll_with_actionscroll_with_action_timedscroll_with_action_conditionaltry_to_do_this_with_timeoutprocess_browser_logs_for_network_eventszoomwait_for_elementwait_for_element_improvisedwait_for_clickablewait_for_visibilityaction_chaindownload_srcdownload_blob_src_by_xpathdownload_all_blob_srcsdownload_all_img_srcsdownload_all_video_srcsscroll_in_containertrigger_event_webelementis_visible
Package: selenium-smart-locator
selenium-smart-locatorClass encapsulating generating of the Selenium locators.It is designed to be simple and intuitive to use. It provides you various ways how to generate a
Selenium-compatible locators. The class is usable in Selenium element queries.loc=Locator(By.XPATH,'//foo/bar/baz')# Old selenium way of doing itelement=s.find_element(*loc)# Expand the tuple. That's how to use the class.This is a basic sample of how does it work. Now come the usage samples of simplified locators:# When you use this simple format of CSS consisting of tag name, ids and classes, it gets# detected automatically and the result is a CSS selector. IDs and classes are optional.Locator('div#foo.bar.baz')# => Locator(by='css selector', locator='div#foo.bar.baz')# When you specify a plain string and it does not get matched be the preceeding CSS detector# it is assumed it is an XPath expressionLocator('//h1')# => Locator(by='xpath', locator='//h1')# If you pass a Locator instance, it just goes straight throughLocator(Locator('//h1'))# => Locator(by='xpath', locator='//h1')# If you have your own object, that implements __locator__(), then it can also be resolved# by the class. The __locator__() must either return Locator instance or# anything that Locator can process.Locator(my_obj)# You can leverage kwargs to say strategy=locatorLocator(xpath='//h1')# => Locator(by='xpath', locator='//h1')Locator(css='#something')# => Locator(by='css selector', locator='#something')Locator(by='xpath',locator='//h1')# => Locator(by='xpath', locator='//h1')# For your comfort, you can pass a dictionary, like it was kwargsLocator({'by':'xpath','locator':'//h1'})# => Locator(by='xpath', locator='//h1')# You can also use Locator's classmethods, like this:Locator.by_css('#foo')# => Locator(by='css selector', locator='#foo')# Always in format Locator.by_<strategy_name>When you have locators, you can avoid using*by using convenience methods:l=Locator('#foo')browser=Firefox()element=l.find_element(browser)elements=l.find_elements(browser)As you can see, the number of ways how to specify the input parameters offer you a great freedom
on how do you want to structure your locators. You can store them in YAML and you can use
Locator to parse the entries. Or anything else.Available selector strategies:class_namecssidlink_textnamepartial_link_texttagxpathLicenseLicensed under GPLv3