from selenium import webdriver
import time
from lxml import etree
driver = webdriver.Chrome()
driver.get('https://www.lagou.com/jobs/list_python?labelWords=&fromSearch=true&suginput=')
time.sleep(3)
html = driver.page_source
driver.quit()
hTml = etree.HTML(html)
tit_infor = hTml.xpath('//h3/text()')
money_infor = hTml.xpath('//span[@class="money"]/text()')
addr_infor = hTml.xpath('//span[@class="add"]/em/text()')
for title,money,addr in zip(tit_infor,money_infor,addr_infor):
with open('lagou.txt','a',encoding='utf-8') as fp:
fp.write(title+money+addr+'\n')