p6sitlwaz 6 months ago
parent b8cdd65dd0
commit f4983b387d

@ -0,0 +1,40 @@
import requests
from bs4 import BeautifulSoup
def l():
url = "https://www.ncrczpw.com/index.php?m=jobfair&c=index&a=index"
head = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0"
}
r = requests.get(url,headers=head)
r.encoding = 'utf-8'
bea = BeautifulSoup(r.text,'lxml')
text = bea.select("div.td2 a")
arr = []
for i in text:
arr.append(i.get("href"))
arr.pop()
return arr
def text(url):
head = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0'
}
r = requests.get(url, headers=head)
r.encoding = 'utf-8'
ms = BeautifulSoup(r.text, 'lxml')
s = ""
text = ms.select("div.jobfairshow div.txt")
for t in text:
s = s + t.get_text(strip=True) + ","
text = ms.select("div a strong")
for t in text:
s = s + t.get_text(strip=True) + ","
print(s)
arr = l()
print(arr)
for t in range(0,8):
text(arr[t])
Loading…
Cancel
Save