```python
from selenium import webdriver
import json,time,datetime
from selenium.webdriver.support.ui import Select
import sys
direc = r'D:\\'
def count_PDA(userName,password,boxCode):
try:
driver = webdriver.Chrome()
driver.get("http://IP/login")
time.sleep(5)
driver.maximize_window()
time.sleep(2)
driver.find_element_by_name('用户名').send_keys(userName)
time.sleep(2)
driver.find_element_by_name('密码').send_keys(password)
time.sleep(3)
driver.find_element_by_xpath('/html/body/div/div/form/div[3]/button').click()
time.sleep(4)
driver.get_screenshot_as_file(direc+"登录WEB成功-"+rightTime+".png")
driver.find_element_by_xpath('/html/body/div/div/main/div/div[2]/img').click()
time.sleep(4)
driver.find_element_by_xpath('/html/body/div/div/main/div/div[2]/div/div/div[2]/div/input').click()
time.sleep(4)
driver.find_element_by_xpath('/html/body/div/div/main/div/div[2]/div/div/div[2]/div/input').send_keys(str(boxCode)+'\n')
time.sleep(4)
num = driver.find_element_by_xpath('/html/body/div/div/main/div/div/div[2]/div[1]/div[3]/div[6]/span[2]').text
for i in range(0,int(num)):
driver.find_element_by_xpath('/html/body/div/div/main/div/div/div[2]/div[2]/div[2]/img[2]').click()
time.sleep(2)
rightTime = get_date_time()
print(rightTime+" 第"+str(i+1)+'次点击按钮')
time.sleep(4)
driver.find_element_by_xpath('/html/body/div/div/main/div/div/button').click()
time.sleep(5)
except BaseException as e:
print("error:",e)