저기에잇는 제목이다부분을 긁어오고싶은데 오류가나네요 ㅠ
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
import time
def render(url):
request = urlopen(Request(url, headers={'User-Agent': 'Mozilla/5.0'}))
html = BeautifulSoup(request, "html.parser")
titi = html.find_all("div",{"class": "data"}).find_all("div", {"class":"info"})
happy = titi[0].text.strip()
print (happy)
while True:
render("https://happynhappy.com")
time.sleep(5)
어떻게수정해야하죠??
오류가 났다면 코드전체보다 오류메세지를 띄워주시는게 더 도움됨요