Home >  > 常用Python代码收集

常用Python代码收集

0

一、urllib

from urllib.request import urlopen as  uReq
from bs4 import BeautifulSoup as soup

my_url = "https://www.newegg.com/Video-Cards-Video-Devices/Category/ID-38?Tpk=graphic%20card"
# opening up connection, grabbing the page 
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
page_soup = soup(page_html,"html.parser")
print(page_soup.h1)
本文暂无标签

发表评论

*

*