사이트를 고치고 단락으로 나눕니다. 스크랩 한 텍스트를 보면 일부 단락 구분 기호가 올바르게 분할되지 않은 것을 볼 수 있습니다. 문제를 재현하는 코드는 아래를 참조하십시오!BeautifulSoup 파서가 태그별로 올바르게 분할되지 않았습니다.
from bs4 import BeautifulSoup
import requests
link = "http://www.presidency.ucsb.edu/ws/index.php?pid=111395"
response = requests.get(link)
soup = BeautifulSoup(response.content, 'html.parser')
paras = soup.findAll('p')
# Note that in printing the below, there are still a lot of "<p>" in that paragraph :(
print paras[614]
다른 파서를 사용해 보았습니다. 비슷한 문제입니다.
불행히도 작동하지 않습니다 (LXML 또는 response.text을 사용 중) . 제안 tho 주셔서 감사합니다! – Craig