-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 9fe8d8b
Showing
27 changed files
with
7,540 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
|
||
# Release notes | ||
|
||
<!-- do not remove --> | ||
|
||
## 0.2.1 | ||
|
||
### New Features | ||
|
||
- Add `url2md` | ||
([\#2](https://github.com/AnswerDotAI/playwrightnb/issues/2)) | ||
|
||
## 0.2.0 | ||
|
||
### New Features | ||
|
||
- async and sync versions | ||
([\#1](https://github.com/AnswerDotAI/playwrightnb/issues/1)) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,163 @@ | ||
# PlaywrightNB source | ||
|
||
|
||
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --> | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L21" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### get_page | ||
|
||
> get_page (*args, **kwargs) | ||
``` python | ||
page = await get_page() | ||
await page.goto('http://example.org') | ||
``` | ||
|
||
<Response url='http://example.org/' request=<Request url='http://example.org/' method='GET'>> | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L31" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### page_ready | ||
|
||
> page_ready (page, pause=50, timeout=5000) | ||
*Waith until main content of `page` is ready* | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L41" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### frames_ready | ||
|
||
> frames_ready (page, pause=50, timeout=5000) | ||
*Wait until all visible frames (if any) on `page` are ready* | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L54" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### wait_page | ||
|
||
> wait_page (page, pause=50, timeout=5000) | ||
*Wait until page and visible frames (if any) on `page` are ready* | ||
|
||
``` python | ||
sh_url = 'https://help.dyalog.com/19.0/#UserGuide/Installation%20and%20Configuration/Shell%20Scripts.htm' | ||
``` | ||
|
||
``` python | ||
await page.goto(sh_url) | ||
await wait_page(page) | ||
``` | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L60" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### get_full_content | ||
|
||
> get_full_content (page) | ||
*Tuple of page content and dict of frames’ content* | ||
|
||
``` python | ||
cts, iframes = await get_full_content(page) | ||
``` | ||
|
||
``` python | ||
await page.close() | ||
``` | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L73" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### read_page_async | ||
|
||
> read_page_async (url, pause=50, timeout=5000, page=None) | ||
*Return contents of `url` and its iframes using Playwright async* | ||
|
||
``` python | ||
cts,iframes = await read_page_async(sh_url) | ||
``` | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L85" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### read_page | ||
|
||
> read_page (url, pause=50, timeout=5000, page=None) | ||
*Return contents of `url` and its iframes using Playwright* | ||
|
||
``` python | ||
cts,iframes = read_page(sh_url) | ||
``` | ||
|
||
``` python | ||
iframes['topic'][:50] | ||
``` | ||
|
||
'<!DOCTYPE html><html xmlns:madcap="http://www.madc' | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L90" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### h2md | ||
|
||
> h2md (h) | ||
*Convert HTML `h` to markdown using \`HTML2Text* | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L99" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### url2md_async | ||
|
||
> url2md_async (url, sel=None, pause=50, timeout=5000, page=None) | ||
*Read `url` with | ||
[`read_page`](https://AnswerDotAI.github.io/playwrightnb/core.html#read_page), | ||
optionally selecting CSS selector `sel`* | ||
|
||
------------------------------------------------------------------------ | ||
|
||
<a | ||
href="https://github.com/AnswerDotAI/playwrightnb/blob/main/playwrightnb/core.py#L108" | ||
target="_blank" style="float:right; font-size:smaller">source</a> | ||
|
||
### url2md | ||
|
||
> url2md (url, sel=None, pause=50, timeout=5000, page=None) | ||
*Read `url` with | ||
[`read_page`](https://AnswerDotAI.github.io/playwrightnb/core.html#read_page)* |
Oops, something went wrong.