你这样试试:import requests
from bs4 import BeautifulSoup
url = 'https://search.51job.com/list/020000%252C040000%252C030200%252C080200%252C010000,000000,0608,00,9,99,%25E8%2596%25AA%25E9%2585%25AC,2,1.html?lang=c&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99&ord_field=0&dibiaoid=0&line=&welfare='
kv = {'user-agent' : 'Chrome/10'}
r = requests.get(url, headers = kv)
r.encoding = r.apparent_encoding
soup = BeautifulSoup(r.text, 'html.parser')
target = soup("p", class_="t1")
for each in target:
print(each.span.a['title'])
我这里岗位都打印出来了 |