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

Please contact support :) #6

Open
winxalex opened this issue Jul 21, 2024 · 2 comments
Open

Please contact support :) #6

winxalex opened this issue Jul 21, 2024 · 2 comments

Comments

@winxalex
Copy link

Great work man!.

First I want to share some modification that I did. ` async def handle_prompt(self, prompt_text):

    # Get the dialog element
    dialog = await self.page.querySelector('div[role="dialog"]')
   
    if dialog:
        # Get all the link elements
        links = await dialog.querySelectorAll('a')

        for link in links:
            # Get the link text
            link_text = await self.page.evaluate('(element) => element.textContent', link)

            if link_text == 'Stay logged out':
                print('Found a link with text "Stay logged out"')
                await link.click()
                await asyncio.sleep(0.5)
     
 
    prompt_textarea = await self.page.querySelector('#prompt-textarea')
    if prompt_textarea is None:
        print("Cannot find the prompt input on the webpage.\nPlease check whether you have access to chat.openai.com without logging in via your browser.")
        self.session_active = False
        await self.close()
        return
   
 
    try:
        # await self.page.type('#prompt-textarea', prompt_text, {'delay': 3})
        # await self.page.type('#prompt-textarea', prompt_text, {'delay': 1})
        await self.page.type('#prompt-textarea', random.choice(string.ascii_letters))
        await self.page.evaluate(f"() => {{document.querySelector('#prompt-textarea').value = '{prompt_text}';}}")
        await asyncio.sleep(5)`    I'm testing with visible browser so '''Stay logged out''' popup might not come when you work windowless mode. Second thing is typing letter by letter for larger prompt last forever so I type one char to make submit btn enabled and then paste the text.  I saw you change the browser test lib from pypeteer to playwright, but unfortunately both stop to work. I think they done extra protection or some kind of ban. Although normal browser window works just fine.  

image
image

** I tried with Tor browser same thing. They have some kind of protection. Cloud.... get into verification loop even I"m checking I'm human.

@mapluisch
Copy link
Owner

Hey Alex,

thanks a lot for your feedback!
Sorry for the late response, I've been pretty busy lately (just saw your email as well).

I'll look into it and get back to you 😊

@Aryazaky
Copy link

Any updates?

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

3 participants