Answer the question
In order to leave comments, you need to log in
Python,Telebot,URL?
How to make a user send a URL to a telegram bot and automatically extract the product id from it in bold? Like this:
https://www.amazon.com/Logitech-G502-Performance-G...
And the bot just retrieved the
Bot Product ID: Amazon - B07GBZ4Q68
Answer the question
In order to leave comments, you need to log in
def get_site_and_id(link: str) -> str:
product_id = link.split('/', 6)[5]
return f'Amazon - {product_id}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question