- 안녕하세요 제가 첨이라 잘안되는데요
그대로 적은것같은데 오류가자꾸뜹니다
오류내용은 아래와같습니다
import requests
from bs4 import BeautifulSoup
header ={'User-agent':'Mozila/2.0'}
response = requests.get("https://www.naver.com",headers=header)
html =response.text
soup = BeautifulSoup(html,'html.parser')
title = soup.select_one('.link_hdline_article')
print(title)
LEEui-MacBook:파이썬장인의폴더 leeahreum$ /usr/local/bin/python3 /Users/leeahreum/Desktop/파이썬장인의폴더/index.py None
print(title.text)
Traceback (most recent call last): File "/Users/leeahreum/Desktop/파이썬장인의폴더/index.py", line 12, in <module> print(title.text) AttributeError: 'NoneType' object has no attribute 'text'
네~! 감사합니다:)