如何使用python创建谷歌图片幻灯片

问题描述

我正在尝试使用 python 构建图像幻灯片。 S0,我正在尝试不同的方式,但我没有成功。

我正在尝试使用 python 构建谷歌图片幻灯片。 然后我不想下载图像并将其存储在本地图像中,我想获取图像 URL 并在幻灯片中显示。

我正在尝试使用此代码。请帮我建立这个。我在 Windows 10 操作系统中使用 python 3

import time
import csv
from webdriverplus import WebDriver
from itertools import *

csvfile = input("Enter the name of the csv input file . . .")
loopcall = input("Infinite loop? (yes/no) . . .")
delay = input("Time delay for each URL visit (in seconds) . . . ")
delay = int(delay)

urls = csv.reader(open(csvfile,"rU"))

if loopcall == "yes":

    for url in cycle(urls):

        browser = WebDriver('firefox',reuse_browser=True)

        browser.maximize_window()

        browser.get(url[0])

        time.sleep(delay)

elif loopcall == "no":

    for url in urls:

        browser = WebDriver('firefox',reuse_browser=True)

        browser.maximize_window()

        browser.get(url[0])

        time.sleep(delay)

        browser.quit()

else:

    print ("Please enter yes or no to specify the loop . . . ")

这是我的 img.csv 文件

https://www.carzonelanka.lk/wp-content/uploads/2018/11/audi-homepage.png
https://www.extremetech.com/wp-content/uploads/2019/12/SONATA-hero-option1-764A5360-edit-640x354.jpg
https://www.vega.lk/img/evx/Ws4.jpg

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)