This package is used for setting up base locales.
Pay attention, this package does not require the dependency of selenium
while being installed by pip, but selenium
is required to be installed if myselenium
is imported.
To install:
pip install mybase-lucien
To import:
import mybase_lucien
This deals the problems with ip adresses.
from mybase_lucien import myip
It gets current outbound ip address.
- usage
ip = myip.get()
- arguments
There are no arguments. - returned value
A string value, which is the ip address. It would be empty if the program fails to fetch the ip address.
This checks the current operating locales.
from mybase_lucien import mylocale
This determines whether the currently running program is a script file run by the python interpreter or a packaged application.
- usage
is_executable = mylocale.is_exec()
- arguments
There are no arguments. - returned value
A bool value, indicating if this is a packaged application (True for yes).
This fetches the directory the script file or the packaged application is located.
- usage
mydir = mylocale.get_dir()
- arguments
There are no arguments. - returned value
A string value which is the directory mentioned above.
This provides easy-to-use multi-browser support based on the package selenium
.
Pay attention: selenium
must be installed first using:
pip install selenium
from mybase_lucien import myselenium
This returns a browser options object.
- usage
options = myselenium.get_options(browser=myselenium.Browser.Chrome)
- arguments
browser
A string value which represents certain browser types, which can be choose from:# Chrome myselenium.Browser.Chrome # Edge myselenium.Browser.Edge # Firefox myselenium.Browser.Firefox
- returned value
A browser options object.
This initiates a driver of the given browser.
- usage
driver = myselenium.init_browser(browser=myselenium.Browser.Chrome,'/path/to/chromedriver',options=options)
- arguments
browser
A string value which represents certain browser types, which can be choose from:# Chrome myselenium.Browser.Chrome # Edge myselenium.Browser.Edge # Firefox myselenium.Browser.Firefox
- Other arguments
Any argument that can be used when initializing a webdriver.
- returned value
A webdriver instance of the given browser.
This operates the driver to click on the certain element found by xpath.
- usage
clickx(driver,ele)
- arguments
driver
A webdriver instance.ele
A string value which is the xpath of a certain element.
- returned value
There are no returned values.
This operates the driver to input words to the certain element found by xpath.
- usage
enterx(driver,ele)
- arguments
driver
A webdriver instance.ele
A string value which is the xpath of a certain element.
- returned value
There are no returned values.