Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Selenium version for better reliabilty #195

Open
ading2210 opened this issue Jul 24, 2023 · 10 comments
Open

Selenium version for better reliabilty #195

ading2210 opened this issue Jul 24, 2023 · 10 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ading2210
Copy link
Owner

With the current Python-only implementation, it's possible for Poe to slightly alter their website which would completely break the library.

Instead, if we switched to a webdriver, minor changes in the client JS would have little practical effect. The largest drawback to this approach, would be the high amount of overhead it would introduce. However, I believe this trade off is worth it if it allows this library to be much more stable.

@ading2210 ading2210 added enhancement New feature or request help wanted Extra attention is needed labels Jul 24, 2023
@haruki-py
Copy link

idk. I think ok. But i dont understand what you mean. Are you switching to js? Then a big no from me

@ading2210
Copy link
Owner Author

ading2210 commented Jul 24, 2023

But i dont understand what you mean. Are you switching to js?
@Anandkrishna34

No, my plan is to use browser automation instead of using something requests-based, so the Python code would be responsible for controlling browser actions rather than directly sending the requests. I also don't plan on discontinuing the current implementation.

@claell
Copy link

claell commented Jul 24, 2023

The funny thing is that I thought "okay, I'll use this API, as it probably is more stable than the ChatGPT Python packages relying on Selenium". Usually, APIs can be more stable and reliable, but of course not when the company is actively breaking things.

So maybe it's the right way to go. Possibly also some hybrid approach where one authenticates once through Selenium and then the values are stored locally for usage with the API.

@huyremy
Copy link

huyremy commented Jul 24, 2023

But i dont understand what you mean. Are you switching to js?
@Anandkrishna34

No, my plan is to use browser automation instead of using something requests-based, so the Python code would be responsible for controlling browser actions rather than directly sending the requests. I also don't plan on discontinuing the current implementation.

I just type pip install selenium in terminal. Please wait, I start reading the docs which show me "How to use selenium?". I think use selenium like new adapter it's a great idea.

@canxin121
Copy link
Contributor

i recommend use playright instead, and actually i had made a playright version, but it's abandoned because the consumption performance is too high.

@akl7777777
Copy link

You can perform operations such as retrieving form key using a headless browser, instead of implementing all APIs using a regular browser.

@canxin121
Copy link
Contributor

canxin121 commented Jul 25, 2023

You can perform operations such as retrieving form key using a headless browser, instead of implementing all APIs using a regular browser.

you can't, now what ever you do, you need to retrieve tag_id, and retrieving tag_id is as hard as retrieving formkey, and it's different in every operation, so it also need headless browser. #196

@huyremy
Copy link

huyremy commented Jul 25, 2023

No, my plan is to use browser automation instead of using something requests-based, so the Python code would be responsible for controlling browser actions rather than directly sending the requests. I also don't plan on discontinuing the current implementation.


I've just read book about selenium to learn how to use that driver, this is my first step (https://github.com/huyremy/Selen-Poe), certainly I found error, Poe's SMTP was down. Have no email to me when I wanna get active code, that's the reason why I can't continue configuration.
(PS: I will be back)

(PS2: I'm pretty sure that if we change solutions...Not use wsocket, we change, we use selenium to dev robot adapter, POE's owner will not be able to ban us).

@huyremy
Copy link

huyremy commented Jul 26, 2023

we will be back,poe!

Yessssss,yessssssssssssssssssss, it's work. I run
pip install .
Then it's work
Screenshot from 2023-07-27 04-00-29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants
@huyremy @claell @canxin121 @ading2210 @akl7777777 @haruki-py and others