欢迎光临
一直在努力

爬取51job上苏州的岗位数量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#enconding=utf-8
import selenium.webdriver
import re
def getnumber(searchname):
    url="https://search.51job.com/list/070300,000000,0000,00,9,99,"+searchname+",2,1.html?lang=c&stype=&postchannel=0000&workyear=99&cotype=99&degreefrom=99&jobterm=99&companysize=99&providesalary=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&from=&welfare="
    driver=selenium.webdriver.Firefox()
    driver.get(url)
    getpage=driver.page_source
    restr="""<div class="rt">([\s\S]*?)</div>"""
    regex=re.compile(restr,re.IGNORECASE)
    mystr=regex.findall(getpage)
    newstr=mystr[0].strip()
    restr="""共(\\d+)条职位"""
    regex=re.compile(restr,re.IGNORECASE)
    mylist=regex.findall(newstr)
    driver.close()
    return mylist[0]
jobs=[]
while True:
    want=input("请输入你想了解的苏州职位,结束请按'q':")
    if want =='q':
        break
    else:
        jobs.append(want)
for job in jobs:
    print("苏州"+job+"职位数量是: "+getnumber(job))
赞(0)
未经允许不得转载:在路上 » 爬取51job上苏州的岗位数量

相关推荐

  • 暂无文章

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址