Article From:https://www.cnblogs.com/liuyun66535309/p/9175545.html
 1 #-*- coding:utf-8 -*-
 2 from selenium import webdriver
 3 import requests
 4 from time import *
 5 
 6 class Zhilian():
 7     def __init__(self,keywords,education,working_life,update_date):
 8         self.keywords=keywords
 9         self.education=education
10         self.working_life=working_life
11         self.update_date=update_date
12 
13     def login(self):
14         # Open the browser
15         self.driver=webdriver.Chrome()
16         #self.driver=webdriver.Firefox()
17         self.driver.maximize_window()
18         self.driver.implicitly_wait(10)
19         #self.url='https://www.baidu.com'
20         self.url='https://passport.zhaopin.com/org/login'
21         self.driver.get(self.url)
22         # Login think Union
23         self.driver.find_element_by_id("loginName").send_keys("ozrgjhwsz013")
24         self.driver.find_element_by_id("password").send_keys("ldxy@201806")
25         sleep(30)
26         self.driver.find_element_by_id("loginbutton").click()
27 
28     def quit(self):
29         sleep(5)
30         self.driver.quit()
31 
32     def search(self):
33         bs=self.driver
34         # Input key words
35         bs.find_element_by_xpath('//a[@href="//rd5.zhaopin.com/search"]').click()
36         bs.find_element_by_xpath('//*[@id="form-item--1"]/div/input').send_keys(self.keywords)
37         # Choice of Education
38         bs.find_element_by_xpath('//*[@id="form-item-12"]/div[1]/div/span/span/i[1]').click()
39         bs.find_element_by_xpath(u'//li[@data-label="%s"]/span'%self.education).click()
40         # Selection of working life
41         bs.find_element_by_xpath('//*[@id="form-item-13"]/div[1]/div/span/span/i[1]').click()
42         bs.find_element_by_xpath(u'//li[@data-label="%s"]/span'%self.working_life).click()
43         # Select the update date
44         bs.find_element_by_xpath('//*[@id="form-item-38"]/div/div/span/span/i[1]').click()
45         bs.find_element_by_xpath(u'//li[@data-label="%s"]/span'%self.update_date).click()
46         # Talent search
47         bs.find_element_by_xpath('//*[@id="resume-filter-form"]/div[2]/div/button[3]').click()
48 
49     def result_screening(self):
50         pass
51 
52 if __name__=='__main__':
53     # Key word
54     keywords='java'
55     # Education
56     education='Junior College'
57     # Working life
58     working_life='1year'
59     # Update date
60     update_date='The last three days'
61     driver=Zhilian(keywords,education,working_life,update_date)
62     driver.login()
63     driver.search()

 

Link of this Article: zhilianceshi

Leave a Reply

Your email address will not be published. Required fields are marked *