fix: follow site dom change

This commit is contained in:
NateScarlet 2023-05-14 14:20:56 +08:00
parent 43ade74e48
commit 868d0eb712
No known key found for this signature in database
GPG Key ID: 5C242793B070309C

View File

@ -128,7 +128,7 @@ def get_paper(url: str) -> str:
_raise_for_status_200(response)
response.encoding = "utf-8"
soup = bs4.BeautifulSoup(response.text, features="html.parser")
container = soup.find("td", class_="b12c")
container = soup.find(id="UCAP-CONTENT")
assert container, f"Can not get paper container from url: {url}"
ret = container.get_text().replace("\u3000\u3000", "\n")
assert ret, f"Can not get paper content from url: {url}"