-2
from bs4 import BeautifulSoup
from pprint import pprint
import requests
url = "http://chk.tbe.taleo.net/chk01/ats/careers/searchResults.jsp?org=CDI&cws=1"
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
table_main = soup.select("table#cws-search-results")
table = table_main.find_all("tr")
for tr in table:
job_title = tr.find_all("a")
job_location = tr.find_all("b")
job = {
"job_title": job_title,
"job_location": job_location
}
data.append(job)
pprint(jobs)
任何人都可以幫助我嗎? –
這是一個非常明顯的錯誤,一個簡單的打印可以幫助你弄清楚。 –