The Python Web Auto Drive Framework.
The pywad is framework for driving the web browser automatically,
using selenium. Need Selenium and python binding of it(selenium-2.35.0 or later).
And need the Chrome Driver if you want to be use Google Chrome.
But we have not been able to support it not yet.
Now, Firefox only.
install
===========
Need Selenium,
see http://www.seleniumhq.org/
Next, execute command.::
$ pip install pywad
How to use
===========
The pywad.Part control the browser when pywad.Part.is_target() return True.
:term:`browser` is a selenium's WebDriver object. :term:`status` is a dictionaly,
but anything ok. The mission of it is to communicate datas for other part object.
For example,
::
from pywad import Part
from pywad.decorator import url_match
class GoogleTop(Part):
def _is_search_button(self, text):
for word in self.search_words:
if word in text:
return True
@url_match('www\.google\.')
def is_target(self, browser, status):
return True
def run(self, browser, status):
entries = browser.find_elements_by_css_selector('input')
for entry in entries:
if entry.get_attribute('type') == 'text':
entry.send_keys('test\n\n')
Next, let running it using Runner object. The Runner object is list-like object.
It expects that the Part object enters. Run the parts objects if execute Runner.run().
::
def main():
url = 'http://www.google.com'
runner = Runner()
runner.append(GoogleTop())
runner.run(url)
if __name__ == '__main__':
main()
The pywad is framework for driving the web browser automatically,
using selenium. Need Selenium and python binding of it(selenium-2.35.0 or later).
And need the Chrome Driver if you want to be use Google Chrome.
But we have not been able to support it not yet.
Now, Firefox only.
install
===========
Need Selenium,
see http://www.seleniumhq.org/
Next, execute command.::
$ pip install pywad
How to use
===========
The pywad.Part control the browser when pywad.Part.is_target() return True.
:term:`browser` is a selenium's WebDriver object. :term:`status` is a dictionaly,
but anything ok. The mission of it is to communicate datas for other part object.
For example,
::
from pywad import Part
from pywad.decorator import url_match
class GoogleTop(Part):
def _is_search_button(self, text):
for word in self.search_words:
if word in text:
return True
@url_match('www\.google\.')
def is_target(self, browser, status):
return True
def run(self, browser, status):
entries = browser.find_elements_by_css_selector('input')
for entry in entries:
if entry.get_attribute('type') == 'text':
entry.send_keys('test\n\n')
Next, let running it using Runner object. The Runner object is list-like object.
It expects that the Part object enters. Run the parts objects if execute Runner.run().
::
def main():
url = 'http://www.google.com'
runner = Runner()
runner.append(GoogleTop())
runner.run(url)
if __name__ == '__main__':
main()
Metadata
Release files for pywad 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pywad-0.1.4.tar.gz | 4.6 kB | Without provenance | Details |
Release files / pywad-0.1.4.tar.gz
| Download URL | pywad-0.1.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5be21e86919f5e67415a1290e3748083bf5f94bc05728d769299a48882d3bc95
|
|
BLAKE2b-256 checksum How to use checksums |
5bef6c290145ea829244602dedb694d4eee0a21f8adf149ff4a3a15389f3b79c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pywad 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.