| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
bas-remote-python - Python library, which allows you to automate Google Chrome browser.
In order to make it possible, BrowserAutomationStudio application is used. bas-remote-python allows you to call and control execution of functions created in BAS. Consider following example, you have a BAS function, which executes specified Google search query and returns result as a list of urls. Using this library, you can call that function in any Python application and obtain result. You can distribute applications written with bas-remote-python library as well.
BAS - is application that allows you to automate any activities in Google Chrome browser with a help of visual programming and without knowing of any programming language. You can think of it as IDE created especially for browser automation:
Check following link for more info:
https://bablosoft.com/shop/BrowserAutomationStudio
pip install bas-remote-python
Following code will search for cats query in Google and output result into console. You can just copy paste this code and run it.
import asyncio
from bas_remote import BasRemoteClient
from bas_remote import Options
async def main():
# Set script name, and optionally auth details (login, password).
options = Options(script_name='TestRemoteControl')
# Create client.
script_client = BasRemoteClient(options)
# Start application, this may take some time.
await script_client.start()
# Set parameters for function.
script_params = {'Query': 'cats'}
# Run function and wait for result.
# Following function will return list of strings.
result = await script_client.run_function(
'GoogleSearch', # or 'YourFunctionName'
script_params)
# Iterate and output results.
for link in result:
print(link)
await script_client.close()
if __name__ == '__main__':
asyncio.run(main())Checkout wiki for more examples.
Previous example used TestRemoteControl project and GoogleSearch function defined in it. In most cases you want to use your own projects and functions. In order to do it:
After project with function is prepared, you can use it from Python. In order to do that, change script and function name in example above.
Following diagram will explain project architecture:
Running custom code section explains how to prepare your project and upload it into the cloud. Portable BAS instance is downloaded and started automatically, it is also closed automatically when BasRemoteClient gets closed. Folder, where portable BAS instance is located by default is data folder relative to executable. It can be customized by using options.working_dir setting.
You can use TestRemoteControl project in order to test bas-remote-python library. It is already uploaded into the cloud and can be used without authentication. List of available functions:
Project source code can be downloaded here
bas-remote-python has MIT license.
You can distribute applications using bas-remote-python library, including commercial, to user, who don't have BAS premium subscription without any fees.
In order to create project with custom functions you need to have a BAS premium subscription.
In other words, only developers must have BAS premium subscription, not users.
| Back | FazBrowse Home | New Git URL |