kimsia
kimsia
WWindmill
Created by kimsia on 8/21/2024 in #help
[Solved] How to have a script to search for emails inside Gmail using the resource?
No description
15 replies
WWindmill
Created by kimsia on 8/14/2024 in #help
lsp pull appears to take a very long time
No description
3 replies
WWindmill
Created by kimsia on 8/5/2024 in #help
[Solved] Admin account and Google oAuth use the same email - how to resolve? Self hosted
No description
67 replies
WWindmill
Created by kimsia on 8/5/2024 in #help
Self hosted. how to use approval or input step to manually key in login credentials?
I want a script that will perform some actions in substack. The key part is that the script needs to login as me first. I have looked at https://www.windmill.dev/docs/flows/flow_approval and there's such a thing as an approval step. is it possible using chromium worker and then using an approval step for me to manually key in my login credentials (which includes 2FA) then performs additional step? I am thinking like this:
input: url (or approval)

go_to_url script: it's a script to visit a login page for substack

input: username, password (or approval)

fill_in_form script: fill in the login using the previous input

input: 2FA code (or approval)

fill_in_form script: fill in the 2FA code

action script: extract the title of the page after redirected
input: url (or approval)

go_to_url script: it's a script to visit a login page for substack

input: username, password (or approval)

fill_in_form script: fill in the login using the previous input

input: 2FA code (or approval)

fill_in_form script: fill in the 2FA code

action script: extract the title of the page after redirected
i found this hub/1541/http/send_get_request step. can it act as the go_to_url script in my flow? Or i need to use with selenoid or selenium? as in this eaxmple https://www.windmill.dev/blog/use-selenium-with-windmill
4 replies
WWindmill
Created by kimsia on 7/30/2024 in #help
[Solved] Browser automation self-hosted: python example for initial login
i have a use case where i need to login to substack manually using my username and password. then followed by my TOTP MFA code. once that's done, i want the rest of the browser automation take over in terms of downloading invoices. I found https://www.windmill.dev/docs/advanced/browser_automation but the examples are all not python. I used claude and tried
import os
from playwright.sync_api import sync_playwright
import wmill

# You can import any PyPi package.
# See here for more info: https://www.windmill.dev/docs/advanced/dependencies_in_python

# you can use typed resources by doing a type alias to dict
# postgresql = dict


def main():
with sync_playwright() as p:
browser = p.chromium.launch(executable_path="/usr/bin/chromium")

page = browser.new_page()
page.goto("https://google.com")

title = page.title()

browser.close()

return title
import os
from playwright.sync_api import sync_playwright
import wmill

# You can import any PyPi package.
# See here for more info: https://www.windmill.dev/docs/advanced/dependencies_in_python

# you can use typed resources by doing a type alias to dict
# postgresql = dict


def main():
with sync_playwright() as p:
browser = p.chromium.launch(executable_path="/usr/bin/chromium")

page = browser.new_page()
page.goto("https://google.com")

title = page.title()

browser.close()

return title
what happens is
Error: BrowserType.launch: Failed to launch chromium because executable doesn't exist at /usr/bin/chromium
File "/tmp/windmill/wk-default-6f5cff974f78-sYQ4l/019102ae-1ce1-eea8-9b82-0fc2d2ee6b6b/u/kimsia/browser_automate_playwright.py", line 14, in main
browser = p.chromium.launch(executable_path="/usr/bin/chromium")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: BrowserType.launch: Failed to launch chromium because executable doesn't exist at /usr/bin/chromium
File "/tmp/windmill/wk-default-6f5cff974f78-sYQ4l/019102ae-1ce1-eea8-9b82-0fc2d2ee6b6b/u/kimsia/browser_automate_playwright.py", line 14, in main
browser = p.chromium.launch(executable_path="/usr/bin/chromium")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I am running locally using docker in my macOS laptop M1 how do i solve this? I am on the Pro Plan trial period.
14 replies