Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Python-Chatbot/web.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
24 lines (19 sloc)
942 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async def YouTubeBrowser(client,message): | |
import requests | |
from bs4 import BeautifulSoup | |
import webbrowser | |
page=requests.get("https://www.youtube.com/") | |
soup=BeautifulSoup(page.text,"html.parser") | |
webbrowser.open("https://www.youtube.com/",new=2) | |
if webbrowser.open("https://www.youtube.com/",new=2)==True: #status printing | |
print("Successful browser, see in a few seconds.") | |
await client.send_message(message.channel,"Successful browser, see in a few seconds.") | |
print("Status: ",page) | |
msg="Status: "+str(page) | |
await client.send_message(message.channel,msg) | |
else: | |
print("I'm sorry. The browser isn't working though.") | |
await client.send_message(message.channel,"I'm sorry. The browser isn't working though.") | |
print("Status: ",page) | |
msg="Status: "+str(page) | |
await client.send_message(message.channel,msg) |