小编del*_*nco的帖子

WebDriverException:消息:服务chromedriver意外退出.状态代码是:127

我想在我的服务器上使用selenium构建我的爬虫.

因此我在我的Ubuntu17.10服务器上安装/下载了所需的依赖项 - 例如chromedriver,chromium-browser等

但是,当我运行以下代码时:

driver = webdriver.Chrome()
Run Code Online (Sandbox Code Playgroud)

它返回以下错误:

---------------------------------------------------------------------------
WebDriverException                        Traceback (most recent call last)
<ipython-input-14-2cdab8938403> in <module>()
----> 1 driver = webdriver.Chrome()

/home/zachary/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options)
     66             service_args=service_args,
     67             log_path=service_log_path)
---> 68         self.service.start()
     69 
     70         try:

/home/zachary/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py in start(self)
     96         count = 0
     97         while True:
---> 98             self.assert_process_still_running()
     99             if self.is_connectable():
    100                 break

/home/zachary/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py in assert_process_still_running(self)
    109             raise WebDriverException(
    110                 'Service %s unexpectedly exited. Status code was: %s'
--> 111                 % …
Run Code Online (Sandbox Code Playgroud)

python selenium google-chrome selenium-chromedriver selenium-webdriver

12
推荐指数
5
解决办法
3万
查看次数

woocommerce 评级星星错误:“SSSSS”

我在我的网站上使用 Woocommerce,但它不断产生错误的星级评级,例如“SSSSS”和星星形状重叠。

已经计算出“S”的数字是收视率,但是,它应该被彩色星星取代。

我应该如何修复代码?

在此输入图像描述

将尝试附加整个 woocommerce 源代码库。所以请告诉我是否需要。

下面是我现在怀疑的代码。评论.php

<?php
/**
 * Display single product reviews (comments)
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/single-product-reviews.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of …
Run Code Online (Sandbox Code Playgroud)

wordpress woocommerce

2
推荐指数
1
解决办法
3338
查看次数

如何在 Pandas 数据框中将带逗号的字符串数字转换为浮点数

我有一个 600x30 大小的 .csv 文件,其所有数据类型都是字符串但实际上是数字类型,例如:

'36,000' == 36000

我想最有效地将所有这些转换为浮动。

我怎样才能做到这一点?

我可以想到使用 split() 分解每个 str 类型的数字,然后擦除 ',' 然后加入然后再次转换为浮点数..但它看起来太麻烦了。

有什么更好的主意吗?

python pandas

2
推荐指数
1
解决办法
5798
查看次数