import requests
url = "http://www.daum.net"
response = requests.get(url)
print(response.text)
#print(response.url)
#print(response.content)
#print(response.encoding)
#print(response.headers)
#print(response.json)
#print(response.links)
#print(response.ok)
#print(response.status_code)
from bs4 import BeautifulSoup
import requests
from datetime import datetime
url = "http://www.daum.net/"
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
rank = 1
results = soup.findAll('a','link_favorsch')
print(datetime.today().strftime("%Y년 %m월 %d일의 실시간 검색어 순위입니다.\n"))
for result in results:
print(rank,"위 : ",result.get_text(),"\n")
rank += 1
translator = Translator()
sentence = "좋은 아침이에요"
result = translator.translate(sentence, dest="en")
detect = translator.detect(sentence)
print("\n============= 번역 결과 ============\n")
print(detect.lang,":", result.origin)
print(result.dest,":", result.text)
print("\n====================================\n")