首页 > 解决方案 > 如何在“数据”处无延迟地访问网页;在 Python 中使用 Selenium Chromedriver 的页面?

问题描述

我在 Python 中使用 Selenium 和 Chrome 网络驱动程序,当我运行脚本时,它会正常打开 chrome,但它在“数据”中等待;页面大约 10 秒,而不是正常进入页面。我可以跳过等待时间并立即转到页面吗?有我的代码:

class Instance():
    driver=None
    url=None

    def __init__(self, url):

        self.url=url

    def runInstance(self):
        self.driver = webdriver.Chrome(executable_path = "C:\chromedriver.exe")
        self.driver.get(self.url)

instance = Instance("https://www.youtube.com/")
instance.runInstance()

标签: pythonseleniumgoogle-chromewebdriver

解决方案


推荐阅读