soup 查找网页所有A的href

url="https://www.liepin.com/campus/"
import requests
from bs4 import BeautifulSoup
rr=requests.get(url)
soup =BeautifulSoup(rr.text, "lxml")
for itema in soup.select(".job-item"):
    uu=itema.select_one("a").get('href').split("?")[0]
    #print(uu)
for itema in soup.select(".job-list-item"):
    uu=itema.select_one("a").get('href').split("?")[0]
    #print(uu)
for ii in soup.find_all('a'):
    print(ii['href'])

 

上一篇:NOIP2017 宝藏


下一篇:小程序授权登陆