Selenium练习
小练习
前程无忧网站
* 自动化爬取杭州 python工程师职务 点击输入框 输入python 点击城市 取消原有城市 添加北京 点击确定
实例
from selenium import webdriver
# webdriver:相当于浏览器的遥控器
borwser = webdriver.Chrome()
# 等待元素出现的时间
borwser.implicitly_wait(10)
borwser.get(url='https://www.51job.com/')
ele = borwser.find_element_by_id('kwdselectid')
ele.send_keys('python')
eles = borwser.find_element_by_id('work_position_input')
eles.click()
dles = borwser.find_element_by_id('work_position_click_ip_location_000000_170700')
dles.click()
ales = borwser.find_element_by_id('work_position_click_center_right_list_category_000000_010000')
ales.click()
cles = borwser.find_element_by_id('work_position_click_bottom_save')
cles.click()