【问题标题】:How to get the entire web page source using Selenium WebDriver in python [duplicate]如何在python中使用Selenium WebDriver获取整个网页源[重复]
【发布时间】:2016-05-30 21:48:35
【问题描述】:

我在 python 中使用 Selenium WebDriver,我想在一个变量中检索网页的整个页面源(类似于许多网络浏览器提供的用于获取页面源的右键单击选项)。

感谢任何帮助

【问题讨论】:

    标签: python selenium-webdriver


    【解决方案1】:

    你的 WebDriver 对象应该有一个page_source 属性,所以对于 Firefox 来说它看起来像

    from selenium import webdriver
    driver = webdriver.Firefox()
    driver.page_source
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-26
      • 1970-01-01
      • 2015-06-14
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      • 2014-01-26
      相关资源
      最近更新 更多