python爬虫----selenium实战(爬取腾讯招聘)

声明 : 本篇仅学习使用,不到将其用于其他途径.

import time,pymongo
#先导入驱动,我这边用的谷歌的
from selenium import webdriver
#显式延时等待
from selenium.webdriver.support.wait import WebDriverWait
#对网页上元素是否存在,可点击等等进行判断,一般用于断言或与WebDriverWait配合使用
from selenium.webdriver.support import expected_conditions as ec
##实现by功能,该功能用于指定查找方式
from selenium.webdriver.common.by import By
#需要用到多线程
from threading import Thread

client = pymongo.MongoClient()
coll = client['Tencent']['job']
#这里是屏蔽网站对webdriver的检测
options = webdriver.ChromeOptions()
options.add_argument('--disable-blink-features=AutomationControlled')
browser = webdriver.Chrome(options=options)
#延时等待,最长等待10秒
wait = WebDriverWait
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值