Python Telethon - python-3.x

I've been searching through the python telethon docs and didn't find a solution. I need to create a function which will:
Send message (red), then the bot will send a message with inline buttons (i know how to click on them)
I will click on first inline button (green), the bot will send another message with 2 inline buttons. I need to get link from message and then click on first inline button
What should I use and how?

Related

How to add clickable code in text message(SMS)?

I am sending a One time passworde or verification code from my node js application. I am actually sending this text
const message = `Nekmart.Do not share PIN and security code with others.
Nekmart never asks for those. Your Nekmart security code is ${otp} .
Validity 5 minutes.`
But When I received this text as SMS. I found the OTP code is not clickable. Like the following image-
But I see many SMS with this type of verification code with clickable functionality. Like somthigng-
Here We can see this is clickable. When someone click to that area, they can see some options.
My question is When I send the message text Then Why that otp code is not clickable. How can I do that?
SMS messages are only text, you cannot mark them up in any way to make the SMS application render them differently. It is entirely down to the SMS application on the device for how it decides to render the message and whether it makes an OTP code clickable.
There is nothing that you can do here.
It's true that SMS messages are just straight text and cannot be formatted, but systems interpret the codes on their own. For example, when you write "Your invite code is: 01010101", iOS will make it clickable.

Check if a webelement is "clickable" before you click it - Selenium VBA

Forgive what is potentially an obscure question.
In the webtable displayed below the following code will click on the highlighted radio button and fire the JS associated with its "click" event.
Set myEle = ch.FindElementById("__M5_1_1_image")
myEle.Click
For reasons I will not bore you with, I am trying to write a function which will check if you can click on this (or another candidate webelement in the table) WITHOUT actually clicking on it as I do not want to fire the associated "click" event at this stage of the code. However, I do want to know that the webelement I have specified will not throw an error or produce no event when I do click it later.
I have tried .ClickAndHold and .ReleaseMouse as tests to see if the same potential errors are returned as with the use of .click, but this does not work. For example I can get a "Element not interactable error" with .click but no error with the other 2.
Going back to the webpage I notice that this (and all the other tables I want to apply this function to) change the mouse cursor from an arrow to a "pointing hand" graphic when you hover the mouse over the correct element (e.g. radio button image in this example). Hence, one method would be to look for the presence of the "mouseover" event in the list of event listeners for the specific webelement - as highlighted right lower pane of the image. Unfortunately I don't have any idea how to check the "event listeners" associated with a defined webelement using selenium and VBA. For example if I fire the mouseover event for a webelement would it return an error if no such event existed or would there merely be no action? I assume it is the later, so can anyone tell me if it is possible to query whether a specific event is associated on the webpage for a defined webelement?

How to select and add text to the email with selenium in python?

I'm trying to write program, that logins to my e-mail account and sends the mail to the provided recipient. For that I' using selenium.
The problem I'm meeting, that I can't find the correct id or class of the message content block, so the email which I send is empty.
My code's fragment:
try:
bodyElem = browser.find_element_by_id('eml-cke__body')
bodyElem.send_keys('Some text to send to a recipient')
except:
print('Was not able to find an element with that name.')
I'm using browser inspector, and when I hover on the content box, I get info provided in an image bellow:
But when I try to find given element the program finds nothing, so text isn't added.
I want to know what I'm doing wrong when searching for the right id or class for that field and how I can do it correctly.
The Page Source of "compose message window"
you can use send_keys only for input tags

Is there any way to have button in chat-bot created using Python, Flask, Chatterbot?

I have tried to create chatbot using Python with Flask framework and Chatterbot module. Since We are training data from YAML file, GUI programming to get answers it bit confusing. I want to get button for some of Bot response when user clicks on particular button, bot should reply accordingly.
For Example -
Human - search some music.
Bot - What kind of Music you like.?
(Button 1 - Rock) (Button 2 - Classic) (Button 3- Pop)
(When user clicks on any of button, but should answer like that way. If user clicks on Pop)
Human - Pop
Bot - great, searching Pop music for you.!
Is there any way to structure YAML file for button.? Or any other way.?

Create tab and send a message from popup.html

I want to create a tab and send a message to it from popup.html
I can create a tab with chrome.tabs.create and can get the tab's id, but while the tab.status is loading the messaging is not possible.
Also it is not possible to wait until chrome.tabs.get returns status=complete because callback function doesn't execute (bug?)
I can't think another possibility to send a message to a tab from popup.html.
Please help :)

Resources