Html 문에서 태크 a 의 속성인 href 의 링크주소를 가져오려고 합니다.
제가 짠 코드로는 계속해서 다음과 같은 에러가 나옵니다.
b = b.a['href']
TypeError: 'NoneType' object is not subscriptable
무엇이 잘못 된 걸 까요?
코드는 밑에와 같습니다.
browser.get("http://www.albamon.co.kr/")
alba = BeautifulSoup(browser.page_source, 'html.parser')
brands = alba.find(id = "MainSuperBrand").find_all("li")
for b in brands :
b = b.a['href']
print(b)