import asyncio
from arsenic import get_session, keys, browsers, services
async def hello_world():
service = services.Geckodriver()
browser = browsers.Firefox()
async with get_session(service, browser) as session:
await session.get('https://images.google.com/')
search_box = await session.wait_for_element(5, 'textarea[name="q"]')
await search_box.send_keys('Cats')
await search_box.send_keys(keys.ENTER)
await asyncio.sleep(10)
def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(hello_world())
if __name__ == '__main__':
main()
import time
from telebot import types
current_step = None
def family_buttons(message):
global current_step
email(message)
current_step = 'email'
def email(message):
markup = types.InlineKeyboardMarkup(row_width=1)
email_button = types.InlineKeyboardButton('Введите почту', callback_data='email')
markup.add(email_button)
bot.send_message(message.chat.id, 'Время заполнения поля 30 секунд', reply_markup=markup)
def phone_code(message):
markup = types.InlineKeyboardMarkup(row_width=1)
phone_code_button = types.InlineKeyboardButton('Введите код телефона', callback_data='phone_code')
markup.add(phone_code_button)
bot.send_message(message.chat.id, 'Нажмите для заполнения поля!', reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback(call):
global current_step
if call.message:
if call.data == 'email':
text_email = bot.send_message(chat_id=call.message.chat.id, text='Введите почту')
bot.register_next_step_handler(text_email, next)
elif call.data == 'phone_code':
text_phone_code = bot.send_message(chat_id=call.message.chat.id, text='Введите код телефона')
bot.register_next_step_handler(text_phone_code, next)
def next(message):
global current_step
if current_step == 'email':
# Обработка введенной почты
current_step = 'phone_code'
phone_code(message)
elif current_step == 'phone_code':
# Обработка введенного кода телефона
current_step = None
# Здесь можете выполнить какие-то действия после завершения обоих шагов
import sqlite3
import telebot
token = 'ТОКЕН'
bot = telebot.TeleBot(token)
def getAccess(user_id):
with sqlite3.connect('users.db') as conn:
cursor = conn.cursor()
cursor.execute('SELECT user_group_id FROM users WHERE user_id=?',(user_id,))
result = cursor.fetchone()
return result
@bot.message_handler(commands=['admin'])
def repeat_all_message(message):
print(message.chat.id)
bot.send_message(message.chat.id,message.text)
access = getAccess(message.chat.id)
if access:
if access[0] == '1':
bot.send_message(message.chat.id,'Привет Admin!')
else:
bot.send_message(message.chat.id,'Привет User!')
else:
bot.send_message(message.chat.id,'Вы не зарегистрированны в системе!')
if __name__ == '__main__':
bot.polling(none_stop=True)
<form>
....
<input type="date" id="birthday" name="birthday" value="1985-12-11">
....
</form>