更新抓取循环!
This commit is contained in:
		@@ -123,22 +123,24 @@ def ScrapRepairOrderData():
 | 
			
		||||
        startDateElement = wb_ie.find_element_by_id('createStartDate')
 | 
			
		||||
        endDateElement = wb_ie.find_element_by_id('createEndDate')
 | 
			
		||||
 | 
			
		||||
        startDateElement.send_keys('2019-11-10')
 | 
			
		||||
        endDateElement.send_keys('2019-12-10')
 | 
			
		||||
    
 | 
			
		||||
        #开始查询和抓取循环
 | 
			
		||||
        while True:
 | 
			
		||||
            #填写起始日期和终止日期
 | 
			
		||||
            startDateElement.clear()
 | 
			
		||||
            endDateElement.clear()
 | 
			
		||||
            #startDateElement.clear()
 | 
			
		||||
            #endDateElement.clear()
 | 
			
		||||
 | 
			
		||||
            startDateElement.send_keys('2019-11-10')
 | 
			
		||||
            endDateElement.send_keys('2019-12-10')
 | 
			
		||||
            #startDateElement.send_keys('2019-11-10')
 | 
			
		||||
            #endDateElement.send_keys('2019-12-10')
 | 
			
		||||
 | 
			
		||||
            #查询
 | 
			
		||||
            action.move_to_element_with_offset( queryButton, 2, 2 ).perform()
 | 
			
		||||
            action.click(queryButton).perform()
 | 
			
		||||
 | 
			
		||||
            #查询后等待一段时间
 | 
			
		||||
            #time.sleep(2)
 | 
			
		||||
            time.sleep(300)
 | 
			
		||||
    except NoSuchElementException:
 | 
			
		||||
        print('查找不到元素')
 | 
			
		||||
        exit(-1)
 | 
			
		||||
@@ -146,7 +148,7 @@ def ScrapRepairOrderData():
 | 
			
		||||
        print('页面读取错误')
 | 
			
		||||
        exit(-1)
 | 
			
		||||
    finally:
 | 
			
		||||
        #wb_ie.close()
 | 
			
		||||
        wb_ie.close()
 | 
			
		||||
        None
 | 
			
		||||
 | 
			
		||||
    while True:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user