-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
418 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,40 @@ | ||
To run javascript on the current page, you can use the following methods. | ||
|
||
## Accessing the object | ||
|
||
```python linenums="1" | ||
app = FastRPA() | ||
web = app.browse('https:...') | ||
type(web.console) | ||
``` | ||
|
||
```python title="Output" | ||
fastrpa.core.console.Console | ||
``` | ||
|
||
## Reference | ||
|
||
# To just evaluate a simple expression | ||
### Evaluate a simple expression | ||
|
||
```python linenums="1" | ||
web.console.evaluate('2 + 2') | ||
``` | ||
|
||
```python title="Output" | ||
4 | ||
``` | ||
|
||
### Run multi line scripts | ||
|
||
# To run complex and multi line scripts, use this | ||
web.console.run(['button = document.getElementById("myButton")', 'button.click()']) | ||
```python linenums="1" | ||
web.console.run([ | ||
'button = document.getElementById("myButton")', | ||
'button.click()' | ||
]) | ||
``` | ||
|
||
# To run a script file, use this | ||
### Run a javascript file | ||
|
||
```python linenums="1" | ||
web.console.run_script('/path/to/script.js') | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,91 @@ | ||
An abstraction to manage cookies on the current domain. | ||
|
||
## Accessing the object | ||
|
||
```python linenums="1" | ||
app = FastRPA() | ||
web = app.browse('https:...') | ||
type(web.cookies) | ||
``` | ||
|
||
```python title="Output" | ||
fastrpa.core.cookies.Cookies | ||
``` | ||
|
||
## Reference | ||
|
||
### Get the list of cookies on the current domain | ||
|
||
# Get the list of cookies on the current domain | ||
```python linenums="1" | ||
web.cookies.list | ||
``` | ||
|
||
```python title="Output" | ||
[Cookie(...), Cookie(...)] | ||
``` | ||
|
||
### Get the list of names from the cookies on the current domain | ||
|
||
# Get the list of names from the cookies on the current domain | ||
```python linenums="1" | ||
web.cookies.list_names | ||
``` | ||
|
||
```python title="Output" | ||
['JSESSIONID', '_ga', ...] | ||
``` | ||
|
||
### Check if a cookie exists on the current domain | ||
|
||
# Check if a cookie exists on the current domain | ||
```python linenums="1" | ||
'my_cookie' in web.cookies | ||
``` | ||
|
||
```python title="Output" | ||
True | ||
``` | ||
|
||
### Check if a cookie stores some value | ||
|
||
# Check if a cookie stores some value | ||
```python linenums="1" | ||
web.cookies.check('my_cookie', 'value') | ||
``` | ||
|
||
```python title="Output" | ||
False | ||
``` | ||
|
||
# Get a cookie on the current domain | ||
### Get a cookie on the current domain | ||
|
||
```python linenums="1" | ||
web.cookies.get('my_cookie') | ||
``` | ||
|
||
```python title="Output" | ||
Cookie(name='...', value='...', domain='...', path='/', secure=True, http_only=True, same_site='Strict') | ||
``` | ||
|
||
### Get a cookie that does not exist the current domain | ||
|
||
# Try to get a cookie that does not exist the current domain | ||
```python linenums="1" | ||
web.cookies.get('my_cookie') | ||
``` | ||
|
||
```python title="Output" | ||
None | ||
``` | ||
|
||
### Add a new cookie on the current domain | ||
|
||
```python linenums="1" | ||
web.cookies.add('my_cookie', 'value') | ||
``` | ||
|
||
# Add a new cookie on the current domain | ||
web.cookies.add('my_cookie', 'value', secure=False) | ||
```python title="Output" | ||
Cookie(name='my_cookie', value='value', domain='...', path='/', secure=False, http_only=True, same_site='Strict') | ||
``` | ||
|
||
### Delete a cookie on the current domain | ||
|
||
# Delete a cookie on the current domain | ||
```python linenums="1" | ||
web.cookies.delete('my_cookie') | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.