TypeError : object of type 'Response'has no len ()
requests와 BeautifulSoup과 관련된 에러로
url의 페이지를 불러오면 'doc'형태로 불러오는데 이것을 beautifulSoup에서 읽으려면
' url.TEXT '로 변환하는 것이 필요함.
>> 아래처럼 입력하면 잘 된다.
import requests
from bs4 import BeautifulSoup
soup = BeautifulSoup(requests.get("your_url").text, 'lxml')
더 상세한 사항은 아래링크로
stackoverflow.com/questions/36709165/beautifulsoup-object-of-type-response-has-no-len
BeautifulSoup: object of type 'Response' has no len()
Issue: when I try to execute the script, BeautifulSoup(html, ...) gives the error message "TypeError: object of type 'Response' has no len(). I tried passing the actual html as a parameter, but it ...
stackoverflow.com
_
반응형