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