Python BeautifulSoup不打印数据

时间:2018-01-02 06:40:09

标签: python-3.x beautifulsoup

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\li‌​b\site-packages

1 个答案:

答案 0 :(得分:0)

HTML位于page.data

soup = BeautifulSoup(page.data, 'html.parser')