0

Hello once again stackoverflow community. I have yet another question for something I am working on. Currently, in Python, I'm working on a simple chat bot to expand my knowledge of Python. On the website I am testing it on, it appears they use entirely jQuery for their chat box.

For example, the jQuery that allows submitting text in their chat-box looks like this:

("#chat_speak").on("click",function(){CurrentChat.chat_say()})

How could I, preferably using the requests library, simulate a function such as 'CurrentChat.chat_say()', or, figure out what POST request to send to achieve the same result as this function would.

Any help on this issue is appreciated, thanks.

1 Answer 1

2

Requests is just a really nice HTTP library. It doesn't execute JavaScript, so there's no way for it to actually do this.

You'll need to use another HTTP library that supports JavaScript, like Ghost.py, which is a headless WebKit browser.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the assistance, I'll see if the Ghost.py library helps in my issues at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.