from selenium.webdriver import Chrome
from selenium.webdriver.common.keys import Keys
import time
web = Chrome()
web.get("http://lagou.com")
el = web.find_element('xpath', '//*[@id="changeCityBox"]/p[1]/a')
el.click()
time.sleep(1)
web.find_element('xpath', '//*[@id="search_input"]').send_keys('python', Keys.ENTER)
time.sleep(1)
web.find_element('xpath', '//*[@id="openWinPostion"]').click()
time.sleep(1)
web.switch_to.window(web.window_handles[-1])
job_detail = web.find_element('xpath', '//*[@id="job_detail"]/dd[2]/div').text
print(job_detail)
web.close()
web.switch_to.window(web.window_handles[0])
print(web.find_element('xpath', '//*[@id="openWinPostion"]'))