# coding:utf-8
'''
获取验证码自动登录
'''
import openpyxl
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
import time
import re
import random
import pandas as pd
from openpyxl import load_workbook
import xlsxwriter as xw
import numpy as np
import xlwt
###填写需要爬取文字的url
url=''
brower=webdriver.Chrome()
brower.get(url)
time.sleep(5)
elements=brower.find_elements(by=By.XPATH,value="//a[@class='el']/div/span[1]")
money=brower.find_elements(by=By.XPATH,value="//p[@class='info']/span[1]")
workers=[]
moneys=[]
for i in elements:
worker=i.text
workers.append(worker)
for j in money:
money=j.text
moneys.append(money)
shuju=dict(zip(workers,moneys))
####方法一:保存到表格中
file=xlwt.Workbook('encoding=utf-8')
sheet1=file.add_sheet('sheet1',cell_overwrite_ok=True)
sheet1.write(0,0,"序号")
sheet1.write(0,1,"工作")
sheet1.write(0,2,"月薪")
for i in range(len(workers)):
sheet1.write(i+1,0,i)
sheet1.write(i+1,1,workers[i])
sheet1.write(i+1,2,moneys[i])
file.save(r'C:UsersAdministratorDesktopdata1.xlsx')
#####方法二:保存到表格中
dic={"worker":workers,"mone":moneys}
df=pd.DataFrame(dic)
print(df)
df.to_excel(r'C:UsersAdministratorDesktopdata1.xlsx')
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
文章目录 1 Spring整合Mybatis思路分析 1.1 环境准备 步骤1:准备数据库表 步骤2:创建项目导入jar包 步骤3:根据表创建模型类 步骤4:创建Dao接口 步骤5:创建Service接口和实现类 步骤6:添加jdbc.properties文件…