我試圖獲取此網站列表中的所有 href:https://nihongonosei.net/?page_id =10246 。該網站非常簡單干凈。查看源代碼后,我發現沒有任何動態。但是,如果我這樣做import requestsurl = 'https://nihongonosensei.net/?page_id=10246'r = requests.get(url)r.textr.text僅包含約20000個字符信息。超過一半的 html 丟失了。我嘗試從“查看頁面源代碼”復制整個 HTML 并直接加載到 Beautifulsoup:from bs4 import BeautifulSouphtml = '' # too long to copy. Here is the link: view-source:https://nihongonosensei.net/?page_id=10246 soup = BeautifulSoup(html, 'html.parser')仍然只保留了大約 20000 個字符,并且 html 的上半部分丟失了。這是我的問題:requests和是否有字符限制BeautifulSoup?如果是這樣,我該如何取消限制?如果沒有,為什么我無法獲取完整的 html?多謝!
- 0 回答
- 0 關注
- 188 瀏覽
添加回答
舉報
0/150
提交
取消