当前位置:网站首页>Selenium saves elements as pictures
Selenium saves elements as pictures
2022-06-26 15:41: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)
Reference resources
https://stackoverflow.com/questions/17361742/download-image-with-selenium-python
边栏推荐
猜你喜欢
Ansible自动化的运用
1. accounting basis -- several major elements of accounting (general accounting theory, accounting subjects and accounts)
PCIe Capabilities List
How to handle 2gcsv files that cannot be opened? Use byzer
sqlite加载csv文件,并做数据分析
在重新格式化时不要删除自定义换行符(Don‘t remove custom line breaks on reformat)
反射修改final
【ceph】CEPHFS 内部实现(一):概念篇--未消化
[CEPH] cephfs internal implementation (IV): how is MDS started-- Undigested
Inaccurate data accuracy in ETL process
随机推荐
【leetcode】331. 验证二叉树的前序序列化
Notes on brushing questions (19) -- binary tree: modification and construction of binary search tree
安全Json协议
音视频学习(二)——帧率、码流和分辨率
[tcapulusdb knowledge base] Introduction to tcapulusdb system management
el-dialog拖拽,边界问题完全修正,网上版本的bug修复
AbortController的使用
/etc/profile、/etc/bashrc、~/. Bashrc differences
1. accounting basis -- several major elements of accounting (general accounting theory, accounting subjects and accounts)
[CEPH] cephfs internal implementation (I): Concept -- undigested
Audio and video learning (III) -- SIP protocol
Sikuli automatic testing technology based on pattern recognition
音视频学习(三)——sip协议
JS simple deepcopy (Introduction recursion)
One click analysis hardware /io/ national network performance script (strong push)
Redis cluster
HR export data Excel VBA
[CEPH] MKDIR | mksnap process source code analysis | lock state switching example
2Gcsv文件打不开怎么处理,使用byzer工具
【ceph】mkdir|mksnap流程源码分析|锁状态切换实例