python2例子(bs4需要pip install,urllib不需要install,是自带的):
import urllib
from bs4 import BeautifulSoup
resp=urllib.urlopen('网站链接')
soup=BeautifulSoup(resp,'html.parser')
python3例子(同样urllib.request不需要安装):
import urllib.request
from bs4 import BeautifulSoup
resp=urllib.request.urlopen('网站链接')
soup=BeautifulSoup(resp,'html.parser')