Closed bakarali64 closed 3 years ago
It's working in playwright debug/headed mode, but it's not loading the needed javascript for the cleverbot.sendAI() call when run headless and I'm not sure why. If anyone has an idea or a fix drop it here or issue a PR.
How do you set playwright into headless mode?
Update:
There's a warning you have to click before you can start using it
It is run in in headless mode by default. To change to headed mode change the line self.p_w.firefox.launch()
to self.p_w.firefox.launch(headless=False)
Or if you want to use debug mode install chromium binary playwright install chromium
and change to self.p_w.chromium.launch()
then run with PWDEBUG=1
Update:
There's a warning you have to click before you can start using it
That's always been there and I've never had to automate that click before, it would still load the needed JavaScript function, and still does in headed mode. Pretty sure a click is not needed still.
Feel free to play around in headed/debug mode and see if you can figure it out. I know they are taking measures to break these unauthorized wrappers and automated tools as it's cutting into their API subscription revenue 🤷 . I've seen them personally comment on libraries like this one.
Also, its giving me this error:
If I dont click the message. Any way to fix this? Also, the accept can be done by executing the noteok() function in console:
If you can do this through playwright, this would probably work.
Also, is there any way to do this through selenium?
I already explained that you don't need to click that to load the JS script and call the function, that's not the issue:
Also, is there any way to do this through selenium?
I used selenium in the version 1.x, it worked for a long time but they started detecting it so I re-wrote it to use playwright. Take a look at the closed issue #15 and you will see.
Is it okay if you can give me the old selenium version of that code? Just curious on how you implemented it.
Ah. Is it okay if you could make a google collab or replit so we can have the same env when working so we can see if that is causing the error.