简体   繁体   English

WebDriverException:消息:[(NS_ERROR_FAILURE)”位置:“JS 框架 :: chrome://marionette/content/proxy.js] 使用 Selenium GeckoDriver 和 Python

[英]WebDriverException: Message: [(NS_ERROR_FAILURE)" location: "JS frame :: chrome://marionette/content/proxy.js] with Selenium GeckoDriver and Python

I am downloading multiple reports from a website.我正在从一个网站下载多个报告。 Each report has its own URL.每个报告都有自己的 URL。 Some URLs are loading fine without a problem.一些 URL 加载正常,没有问题。

But there is one URL that produces the following error.但是有一个 URL 会产生以下错误。 All URLs have the same pattern except for query parameter.除了查询参数外,所有 URL 都具有相同的模式。 If I open the URL on my browser it works fine.如果我在浏览器上打开 URL,它工作正常。

I am using Selenium and the Firefox Driver.我正在使用 Selenium 和 Firefox 驱动程序。 在此处输入图片说明

Below is my code下面是我的代码

if __name__ == "__main__":
firefox_options = Options()
#firefox_options.headless = True
driver = webdriver.Firefox(options=firefox_options, executable_path=firefox_driver_location)



logged_in = "no"
for query in sa360_query_array:
    print("query being processed is " + query )
    if  "270348" in query or "269756" in query:
        wait_time = 300
    else:
        wait_time = 15
    driver.get(query)
    print("Page wait time is " + str(wait_time))
    driver.implicitly_wait(300000)
    #print(driver.page_source)
    if logged_in !="yes":
        google_login(query,email_login,email_password) #This function logs into google account
        print("Sleeping 200 seconds")
        time.sleep(200)

    logged_in = "yes"

    #time.sleep(200)
    print("reading HTML")
    #print(driver.page_source)
    read_web = pd.read_html(driver.page_source)#The error occurs on this line

What is that error referring too?那个错误也指的是什么?

This error message...这个错误信息...

WebDriverException: Message: [Exception...  "Failure"  nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://marionette/content/proxy.js :: sendReply_ :: line 276"  data: no]

...implies that the Marionette threw an error while attempting to read/store/copy the page_source() . ...暗示Marionette在尝试读取/存储/复制page_source()抛出错误。

The relevant HTML DOM / DOM Tree would have helped us to debug the issue in a better way.相关的HTML DOM / DOM Tree可以帮助我们以更好的方式调试问题。 However it seems the issue is with the fact that the page_source() is emencely huge/large which exceeds the max value of the max value Marionette can handle.然而,问题似乎在于page_source()非常巨大/大,超过了Marionette可以处理的最大值的最大值。 Possibly it's a much bigger string you're dealing with.可能这是您正在处理的更大的string


Solution解决方案

A quick solution will be to avoid passing the page_source() to the variable and print it to find out where the actual issue lies.一个快速的解决方案是避免将page_source()传递给变量并打印它以找出实际问题所在。

print(driver.page_source)

Another aspect to look after would be pd.read_html() which I am quite not sure.要照顾的另一个方面是pd.read_html() ,我不太确定。


Reference参考

You can find a couple of relevant discussion in:您可以在以下位置找到一些相关讨论:


Outro奥特罗

Documentation links:文档链接:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WebDriverException:消息:异常......“失败”nsresult:“0x80004005(NS_ERROR_FAILURE)”同时使用Selenium Python保存大型html文件 - WebDriverException: Message: Exception... "Failure" nsresult: "0x80004005 (NS_ERROR_FAILURE)" while saving a large html file using Selenium Python Python Selenium:Chrome 57版本-WebDriverException:消息:未知错误 - Python Selenium: Chrome 57 version - WebDriverException: Message: Unknown Error python selenium:WebDriverException:消息:chrome无法访问 - python selenium: WebDriverException: Message: chrome not reachable selenium.common.exceptions.WebDriverException:消息:未知错误:无法使用带有Selenium Python的ChromeDriver Chrome创建Chrome进程 - selenium.common.exceptions.WebDriverException: Message: unknown error: Failed to create Chrome process with ChromeDriver Chrome with Selenium Python WebDriverException:消息:未知错误:C:/.../Chrome/Application/chrome.exe 处没有 Chrome 二进制文件,带有 ChromeDriver Selenium 和 Python - WebDriverException: Message: unknown error: no chrome binary at C:/.../Chrome/Application/chrome.exe with ChromeDriver Selenium and Python selenium.common.exceptions.WebDriverException:消息:'firefox' 可执行文件需要在 GeckoDriver Firefox Selenium 和 Python 的 PATH 中 - selenium.common.exceptions.WebDriverException: Message: 'firefox' executable needs to be in PATH with GeckoDriver Firefox Selenium and Python Selenium Python selenium.common.exceptions.WebDriverException:消息:使用geckodriver和firefox拒绝连接 - Selenium Python selenium.common.exceptions.WebDriverException: Message: connection refused using geckodriver and firefox selenium.common.exceptions.WebDriverException:消息:使用 GeckoDriver Firefox Selenium Python 时,“Geckodriver”可执行文件可能具有错误的权限 - selenium.common.exceptions.WebDriverException: Message: 'Geckodriver' executable may have wrong permissions using GeckoDriver Firefox Selenium Python selenium.common.exceptions.WebDriverException:消息:Raspberry Pi debian上的GeckoDriver Firefox和Selenium拒绝连接错误 - selenium.common.exceptions.WebDriverException: Message: connection refused error with GeckoDriver Firefox and Selenium on Raspberry Pi debian WebDriverException:消息:未知错误:Chrome 无法启动:使用 ChromeDriver Chrome 和 Selenium Python 异常退出错误 - WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally error using ChromeDriver Chrome and Selenium Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM