[ Web Proxy ]
URL:
Viewing:
https://raw.githubusercontent.com/We2one/Notes/master/python-basic-notes/python-days/Day_54.md
[Back]
[Original]
### #### + 1. 2. 3. + + #### ##### ()--> + OCR (Optical Character Recognition) : ##### OCR (/) + **Tesseract** : Google + Tesseract : , #### Selenium #### ##### + : + : ##### +
1. 2. --> Python --> HTTP WEB 3. + ```python import time from PIL import Image from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait import chaojiying def main(): driver = webdriver.Ie() driver.get("https://inv-veri.chinatax.gov.cn/") wait = WebDriverWait(driver, 20) wait.until(EC.presence_of_element_located((By.XPATH, '//tr/td/input[@id="fpdm"]'))).send_keys("041001900111") wait.until(EC.presence_of_element_located((By.XPATH, '//tr/td/input[@id="fphm"]'))).send_keys("46160592") wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="kprq"]'))).send_keys("20191225") wait.until(EC.presence_of_element_located((By.XPATH, '//tr/td/input[@id="kjje"]'))).send_keys("678071") # seleniumieclick()js # # driver.execute_script('document.getElementById("yzm_img").click()') driver.execute_script('document.getElementById("yzm_img").click()') time.sleep(2) # yzm_code = input(":\t") # wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="yzm"]'))).send_keys(yzm_code) # # # driver.execute_script('document.getElementsByClassName("blue_button")[0].click()') yzm_position = driver.find_element_by_xpath('//*[@id="yzm"]') size = yzm_position.size location = yzm_position.location print(location, size) cp_position = ( location['x']-15, location['y'], location['x'] + size['width'] + 230, location['y'] + size['height'] + 80 ) # print(f"{location['x'], location['y']}\t" # f"{location['x']+size['width'], location['y']}\t" # f"{location['x'], location['y']+size['height']}\t" # f"{location['x']+size['width'], location['y']+size['height']}") driver.save_screenshot("a.png") image = Image.open('a.png') image_pic = image.crop(cp_position) image_pic.save("b.png") c = chaojiying.Chaojiying_Client() im = open("b.png", "rb").read() yzm_code = c.PostPic(im, 5000)['pic_str'] print(yzm_code) input("") wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="yzm"]'))).send_keys(yzm_code) driver.execute_script('document.getElementsByClassName("blue_button")[0].click()') if __name__ == '__main__': main() ``` #### RPA ##### + RPA (Robitic Process Automation ): ,, + RPA , + RPA 1. 2. ,, 3. , 4. RPA ##### + RPA RPA + , AI , selenium ##### + + selenium +
Web Proxy Viewer |
New URL
|
Original Page