网页获取

2021-04-03 11:27

阅读:522

标签:beautiful   网页   bs4   htm   job   rom   imp   requests   获取   

import requests
from bs4 import BeautifulSoup

url = ‘http://fj.huatu.com/zt/2019zwb/‘
def sss(url):

reque = requests.get(url)
reque.encoding=reque.apparent_encoding
return reque.text

html = sss(url)
soup = BeautifulSoup(html,‘html.parser‘)
print(job = soup.select(‘div>h2>ul>li‘))

网页获取

标签:beautiful   网页   bs4   htm   job   rom   imp   requests   获取   

原文地址:https://www.cnblogs.com/ztld/p/12543143.html


评论


亲,登录后才可以留言!