Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to login into web pages? #6

Open
avion23 opened this issue May 4, 2023 · 2 comments
Open

How to login into web pages? #6

avion23 opened this issue May 4, 2023 · 2 comments

Comments

@avion23
Copy link

avion23 commented May 4, 2023

I am seeking to automate the download process from https://sellercentral.amazon.de/payments/allstatements/index.html. Like many other pages, this one requires a login.

However, even when logging in manually, the process continues to crash.

I have noticed that Selenium is used for this purpose, but I have not yet discovered an effective method to incorporate logins. Does anyone have suggestions on how to address this issue?

@avion23
Copy link
Author

avion23 commented May 5, 2023

So I have no Idea what I am doing. This works:

diff --git a/chromegpt/tools/selenium.py b/chromegpt/tools/selenium.py
index 3a02a5f..c0e74c5 100644
--- a/chromegpt/tools/selenium.py
+++ b/chromegpt/tools/selenium.py
@@ -36,16 +36,21 @@ class SeleniumWrapper:
             selenium = SeleniumWrapper()
     """

+
     def __init__(self, headless: bool = False) -> None:
-        """Initialize Selenium and start interactive session."""
         chrome_options = Options()
+
         if headless:
             chrome_options.add_argument("--headless")
         else:
             chrome_options.add_argument("--start-maximized")
+
+        remote_debugging_port = "9222"
+        chrome_options.add_argument(f"--remote-debugging-port={remote_debugging_port}")
+
         self.driver = webdriver.Chrome(options=chrome_options)
         self.driver.implicitly_wait(5)  # Wait 5 seconds for elements to load
-
+
     def __del__(self) -> None:
         """Close Selenium session."""
         self.driver.close()
         

@wu-s-john
Copy link

wu-s-john commented May 10, 2023

I tried to login with my LinkedIn account with this thing. It actually does this automatically for me. It just does this really slowly. You just need to provide your account details and password on the prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants