当前位置:网站首页>selenium将元素保存为图片
selenium将元素保存为图片
2022-06-26 15:16:00 【nongcunqq】
driver = webdriver.Chrome( executable_path=CHROME_DRIVER_PATH)
def login():
driver.get(url_index)
wait = WebDriverWait(driver, 60)
wait.until(EC.visibility_of_element_located((By.XPATH, '//*[@id="Form1"]/div[3]/table/tbody/tr[3]/td[1]/img')))
captcha_elm = driver.find_element(by=By.XPATH, value='//*[@id="Form1"]/div[3]/table/tbody/tr[3]/td[1]/img')
png_path = '1.png'
with open(png_path, 'wb') as file:
file.write(captcha_elm.screenshot_as_png)
参考
https://stackoverflow.com/questions/17361742/download-image-with-selenium-python
边栏推荐
- One click analysis hardware /io/ national network performance script (strong push)
- Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
- Unity C # e-learning (10) -- unitywebrequest (1)
- [tcapulusdb knowledge base] Introduction to tcapulusdb general documents
- /etc/profile、/etc/bashrc、~/.bashrc的区别
- ETL过程中数据精度不准确问题
- Unity C # e-learning (IX) -- wwwfrom
- HR export data Excel VBA
- JS之手写 bind、apply、call
- Principle of TCP reset attack
猜你喜欢

【TcaplusDB知识库】TcaplusDB常规单据介绍

Use of abortcontroller

【毕业季·进击的技术er】 什么是微信小程序,带你推开小程序的大门

Using restcloud ETL shell component to schedule dataX offline tasks

vsomeip3 双机通信文件配置
![[CEPH] cephfs internal implementation (II): example -- undigested](/img/87/6eb214550faf1f0500565c1610ff3b.png)
[CEPH] cephfs internal implementation (II): example -- undigested

Restcloud ETL resolves shell script parameterization

ETL过程中数据精度不准确问题
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction](/img/05/8ec56393cac534cb5a00c10a1a9f32.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction

小程序:uniapp解决 vendor.js 体积过大的问题
随机推荐
Optimizing for vectorization
Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
【TcaplusDB知识库】TcaplusDB系统管理介绍
音视频学习(一)——PTZ控制原理
TCP/IP协议竟然有这么多漏洞?
Learning memory barrier
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
2Gcsv文件打不开怎么处理,使用byzer工具
[tcapulusdb knowledge base] Introduction to tcapulusdb system management
php文件上传00截断
Unity C # e-learning (VIII) -- www
JS之手写 bind、apply、call
English grammar_ Adjective / adverb Level 3 - original sentence pattern
MongoDB系列之适用场景和不适用场景
数据库-视图
RestCloud ETL与Kettle对比分析
[CEPH] cephfs internal implementation (I): Concept -- undigested
HR export data Excel VBA
/etc/profile、/etc/bashrc、~/.bashrc的区别