我已经看到了谷歌提取的结果,但它不适用于此。我想简单地进入代码并更改参数,当运行时,它会进行搜索并抓取职位、位置和日期。这就是我到目前为止所拥有的。任何帮助都会很棒,并在此先感谢。
我希望脚本使用给定的参数(工程师软件 CA)在 monster.com 上执行搜索并抓取结果。
#! /usr/bin/python
import re
import requests
from urllib import urlopen
from BeautifulSoup import BeautifulSoup
parameters = ["Software","Engineer","CA"]
base_url = "http://careers.boozallen.com/search?q="
search_string = "+".join(parameters)
final_url = base_url + search_string
a = requests.get(final_url)
raw_string = a.text.strip()
soup = BeautifulSoup( raw_string )
job_urls = soup.findAll(name = 'a', attrs = { 'class': 'jobTitle fnt11_js' })
for job_url in job_urls:
print job_url.text
print
raw_input("Press enter to close: ")
我知道这在下面可以作为标准刮擦。
handle = urlopen("http://jobsearch.monster.com/search/Engineer_5?q=Software&where=AZ&rad=20&sort=rv.di.dt")
responce = handle.read()
soup = BeautifulSoup( responce )
job_urls = soup.findAll(name = 'a', attrs = { 'class': 'jobTitle fnt11_js' })
for job_url in job_urls:
print job_url.text
print