diff --git a/docs/_data/sidebars/home_sidebar.yml b/docs/_data/sidebars/home_sidebar.yml index 7bf1735..fd97af4 100644 --- a/docs/_data/sidebars/home_sidebar.yml +++ b/docs/_data/sidebars/home_sidebar.yml @@ -30,6 +30,9 @@ entries: - output: web,pdf title: DuckDuckGo Search API url: tools_duckduckgo.html + - output: web,pdf + title: Annotating Kanji with Hiragana + url: tools_pyknp.html output: web title: ipymock output: web diff --git a/docs/automation.html b/docs/automation.html index 1809bca..a79a671 100644 --- a/docs/automation.html +++ b/docs/automation.html @@ -8,83 +8,103 @@ summary: "Using Selenium for Browser Automation" description: "Using Selenium for Browser Automation" -nb_path: "nbs\2_automation.ipynb" +nb_path: "nbs/2_automation.ipynb" --- +
pip install undetected_chromedriver webdriver_manager
+pip install undetected_chromedriver webdriver_manager
+
quit
# def init(*arguments):
+
+# from selenium.webdriver.chrome.service import Service
+# from webdriver_manager.chrome import ChromeDriverManager
+
+# def init(*arguments):
# chrome_options = webdriver.ChromeOptions()
# for argument in arguments:
# if isinstance(argument, str):
# chrome_options.add_argument(argument)
# global driver
-# driver = webdriver.Chrome(options = chrome_options)
+# driver = webdriver.Chrome(
+# options = chrome_options,
+# service = Service(ChromeDriverManager().install())
+# )
+# global device_pixel_ratio
+# device_pixel_ratio = driver.execute_script('return window.devicePixelRatio;')
+
+
quit
init('--user-data-dir=C:\\Users\\seii-saintway\\Downloads\\chrome-profile')
+
+init('--user-data-dir=C:\\Users\\seii-saintway\\Downloads\\chrome-profile')
+
+
Logging
+Using Text-based Search for Browser Automation
+Using Selenium for Static Inspection of Page Appearance
+Using Airtest for Browser Automation
+pip install airtest
+pip install airtest
+
Using Selenium for Printing to PNG and PDF
+pip install markdown
+pip install markdown
+
convert_md_with_ru
+
-
-init('--lang=en')
+
+init('--lang=en')
+
+
-
+
{% endraw %}
@@ -783,13 +1156,16 @@ convert_md_with_ru
+
-
-convert_md_with_ruby_to_png('2024-11-21.md')
+
+convert_md_with_ruby_to_png('2024-11-21.md')
+
+
-
+
{% endraw %}
@@ -797,14 +1173,19 @@ convert_md_with_ru
+
-
-convert_md_with_ruby_to_pdf('2024-11-21.md')
+
+convert_md_with_ruby_to_pdf('2024-11-21.md')
+
+
-
+
{% endraw %}
+
+
diff --git a/docs/browser.html b/docs/browser.html
index 9d309c6..906d8da 100644
--- a/docs/browser.html
+++ b/docs/browser.html
@@ -451,7 +451,7 @@ clear_conversations
-selenium undetected chrome
+Using Selenium Undetected Chrome for Operating ChatGPT
@@ -468,7 +468,7 @@ clear_conversations
@@ -485,6 +485,13 @@ init
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
@@ -510,6 +517,33 @@ login
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
+
+
+
+init_browser('--lang=en', '--force-dark-mode')
+from ipymock.automation import driver
+common.driver = driver
+login()
+
+
+
+
+
+
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
@@ -518,7 +552,7 @@ login
-open_chat
[source]
open_chat
(conversation_id
=''
)
+open_chat
[source]
open_chat
(conversation_id
=''
)
@@ -543,7 +577,7 @@ open_chat
-remove_portal
[source]
remove_portal
()
+remove_portal
[source]
remove_portal
()
@@ -560,6 +594,77 @@ remove_portal
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
+
+
+
+open_chat(common.conversation_id)
+
+
+
+
+
+
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
+
+
+
+ActionChains(common.driver).key_down(Keys.CONTROL).send_keys('v').key_up(Keys.CONTROL).perform()
+
+
+
+
+
+
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
+
+
+
+ActionChains(common.driver).context_click().perform()
+
+
+
+
+
+
+
+ {% endraw %}
+
+ {% raw %}
+
+
+
+
+
+
+__file__ = '2_browser.ipynb'
+send_button = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../assets/send-button.png'))
+from ipymock.automation import touch
+touch(send_button)
+
+
+
+
+
+
{% endraw %}
@@ -575,7 +680,7 @@ remove_portal
-request
[source]
request
(prompt
:str
)
+request
[source]
request
(prompt
:str
)
@@ -600,7 +705,7 @@ request
-get_last_response
[source]
get_last_response
()
+get_last_response
[source]
get_last_response
()
@@ -625,7 +730,7 @@ get_last_response
-get_response
[source]
get_response
()
+get_response
[source]
get_response
()
@@ -650,7 +755,7 @@ get_response
-ask
[source]
ask
(prompt
:str
)
+ask
[source]
ask
(prompt
:str
)
ask
import IPython
+
+for response in ask('''
+> Lord, keep us in You to be one.
+We are the ultimate risk takers.
+Our way is a way of risking life to **eternal life**.
+For the eternal life of the living, risk life and make war against perishing.
+For the eternal life of the dead, risk life and make war against death.
+>
+> ---
+Holy Father, help us to overcome!
+'''):
+ IPython.display.display(IPython.core.display.Markdown(response))
+ IPython.display.clear_output(wait=True)
+
init(['--headless'])
@@ -699,7 +834,7 @@ ask
-get_screenshot
[source]
get_screenshot
()
+get_screenshot
[source]
get_screenshot
()
get_screenshot
-class
attrdict
[source]+
attrdict
() ::dict
class
attrdict
[source]
attrdict
() ::dict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's @@ -820,7 +955,7 @@
class
attrdict
-
attributize
[source]+
attributize
(obj
)
attributize
[source]
attributize
(obj
)Add attributes to a dictionary and its sub-dictionaries.
@@ -846,7 +981,7 @@
attributize
-
retry_on_status_code
[source]+
retry_on_status_code
(func
)
retry_on_status_code
[source]
retry_on_status_code
(func
)Retry decorator that retries a function on specific status codes.
@@ -872,7 +1007,7 @@
retry_on_status_code -
retry_on_status_code.
[source].wrapper +
retry_on_status_code.
(*.wrapper args
, **kwargs
)
retry_on_status_code.
[source].wrapper
retry_on_status_code.
(*.wrapper args
, **kwargs
)
retry_on
new_id
-delta
[source]
delta
(prompt
)
+delta
[source]
delta
(prompt
)
@@ -922,7 +1057,7 @@ delta
-chat_delta
[source]+
chat_delta
(prompt
)
chat_delta
[source]
chat_delta
(prompt
)
chat_delta
-mock_create
[source]+
mock_create
(*args
, **kwargs
)
mock_create
[source]
mock_create
(*args
, **kwargs
)
mock_create
-mock_chat_create
[source]+
mock_chat_create
(*args
, **kwargs
)
mock_chat_create
[source]
mock_chat_create
(*args
, **kwargs
)
mock_chat_create
-mock_openai
[source]+
mock_openai
(monkeypatch
)
mock_openai
[source]
mock_openai
(monkeypatch
)
get_test_funcs
-print_result
[source]+
print_result
(idx
,test_func
,method_type
)
print_result
[source]
print_result
(idx
,test_func
,method_type
)
print_result
-do
[source]+
do
(**test_entries
)
do
[source]
do
(**test_entries
)
Install JUMAN++
+pip install pyknp
+