获取单个网页的内容

刘德胜 75次浏览

摘要:#-*-coding:UTF-8-*- #获取单个网页的内容 importurllib.request url="http://www.baobao-shop.com" data=urllib.request.urlopen(url).read() data=...

# -*- coding: UTF-8 -*-
# 获取单个网页的内容
import urllib.request
url = "http://www.baobao-shop.com"
data = urllib.request.urlopen(url).read()
data = data.decode('UTF-8')
print(data)