poe-api icon indicating copy to clipboard operation
poe-api copied to clipboard

Selenium version for better reliabilty

Open ading2210 opened this issue 2 years ago • 10 comments

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 avatar Jul 24 '23 16:07 ading2210

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

haruki-py avatar Jul 24 '23 16:07 haruki-py

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.

ading2210 avatar Jul 24 '23 17:07 ading2210

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.

claell avatar Jul 24 '23 17:07 claell

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.

huyremy avatar Jul 24 '23 17:07 huyremy

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

canxin121 avatar Jul 25 '23 00:07 canxin121

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

akl7777777 avatar Jul 25 '23 03:07 akl7777777

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

canxin121 avatar Jul 25 '23 03:07 canxin121

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 avatar Jul 25 '23 06:07 huyremy

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

huyremy avatar Jul 26 '23 21:07 huyremy