Python BeautifulSoup不打印数据
import urllib3
import certifi
from urllib3 import PoolManager
from bs4 import BeautifulSoup
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
manager=PoolManager(num_pools=3,cert_reqs='CERT_REQUIRED',ca_certs=certifi.where())
page=manager.request('GET',"https://app.tipotapp.com/docs")
print(page.status)
print(page.headers)
soup = BeautifulSoup(page, 'html.parser')
print(soup.prettify())
-
python --version
Python 3.7.0a2
pip3 install beautifulsoup4 --upgrade
Requirement already up-to-date: beautifulsoup4
in c:\users\naveen\appdata\local\programs\python\python37-32\lib\site-packages
答案 0 :(得分:0)
HTML
位于page.data
soup = BeautifulSoup(page.data, 'html.parser')