for i in range(60):
index='vol1-5338-p'+str(i+2)
final_url=os.path.join('file:///C:\Users\Administrator\AppData\Roaming\Tencent\QQTempSys\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://m.1kkk.com/',index)
driver.get(final_url)
print(final_url)
try:
img_path = driver.find_element_by_xpath(".//img[@id='cp_img']")
except NoSuchElementException:
print('下载完毕')
driver.quit()
sys.exit() #捕获异常后退出程序
img_url = img_path.get_attribute('src') # get_attribute('src') 获取src内的内容
|
|
|
|
|
共 1 个关于本帖的回复 最后回复于 2021-8-6 09:38