python3.7,Selenium + webdriver.Chrome 获取腾讯求职信息四

本文介绍了如何利用Python3.7、Selenium和webdriver.Chrome进行网络爬虫,实现从腾讯网站获取求职信息。经过实践,成功获取了100条职位标题,但在执行过程中发现线程等待的消息出现在了结果的最后。
摘要由CSDN通过智能技术生成

代码:

# -*- coding=utf-8 -*-
import os
import threading
import time
import unittest
import xlwt
import xlrd
from xlutils.copy import copy
from selenium import webdriver
from queue import Queue
import warnings
warnings.simplefilter("ignore", ResourceWarning)


'''
    腾讯职位的前 10 位数据, 并写入 excel, 每页有 10 条信息
    https://careers.tencent.com/search.html?query=co_1&sc=1
    (https://careers.tencent.com/search.html?query=co_1&index=1&sc=1)
    https://careers.tencent.com/search.html?query=co_1&index=2&sc=1
    https://careers.tencent.com/search.html?query=co_1&index=3&sc=1     # 第一页的 URL

'''
line_begin_nmb = 1  # 从第二行开始
dir = os.path.abspath('.').split('src')[0]
old_workbook = xlrd.open_workbook(dir + "./13腾讯求职信息模板.xls", formatting_info=True)  # 把里面的格式复制过来
new_workbook = copy(old_workbook)
new_worksheet = new_workbook.get_sheet(0)


def style_font_xingkai(style):  # 华文行楷
    font = xlwt.Font()
    font.name = u'华文行楷'
    style.font = font
    return style


def style_align_center(style):  # 居中对齐
    alignment = xlwt.Alignment()
    alignment.horz = xlwt.Alignment.HORZ_CENTER
    style.alignment = alignment
    return style


def style_align_left(style):    # 左对齐
    alignment = xlwt.Alignment()
    alignment.horz = xlwt.Alignment.HORZ_LEFT
    alignment.wrap = 1
    style.alignment = alignment
    return style


def 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值