标签:sele item selector list amp win com css_ lag
1 from selenium import webdriver 2 browser=webdriver.Chrome() 3 import time 4 5 def search(): 6 browser.get(‘https://www.lagou.com/jobs/list_%E7%88%AC%E8%99%AB?labelWords=&fromSearch=true&suginput=‘) 7 time.sleep(3) 8 #print(browser.page_source) 9 #browser.execute_script(‘window.scrollTo(0,document.body.scrollHeight)‘) 10 time.sleep(2) 11 i=0 12 for i in range(1,25): 13 browser.execute_script(‘window.scrollTo(0,document.body.scrollHeight)‘) 14 button=browser.find_element_by_css_selector(‘#s_position_list > div.item_con_pager > div > span.pager_next‘) 15 button.click() 16 browser.execute_script(‘window.scrollTo(0,document.body.scrollHeight)‘) 17 time.sleep(2) 18 19 20 search()
标签:sele item selector list amp win com css_ lag
原文地址:http://www.cnblogs.com/realmonkeykingsun/p/7967539.html