如何解决“ ModuleNotFoundError:没有名为'selenium.webdriver.comma'的模块”?

时间:2019-04-20 06:16:04

标签: python python-3.x selenium pip

我试图将硒第一次导入我的新Python项目中。但是,当我运行该程序时,它不起作用,并在下面显示以下消息。

我检查了python和selenium是否正确安装。我什至尝试重新安装它,但仍然显示相同的消息。我刚开始使用Python和Selenium时,可能在某个地方犯了一个愚蠢的错误。有人有解决方案吗?

我的代码:

You can add the code in the blade to retrieve all the products from the product model    


<div class="row">
    @php
    $product = App\Product::all();
    @endphp
        @foreach($product as $data)
            <div class="col-lg-4 col-md-6 mb-4">
                <div class="card h-100">
                    <a href="#"><img src="{{ asset('image/product_image/'.$data->product_image) }}" alt="photo"></a>
                    <div class="card-body">
                        <h4 class="card-title">
                            <a href="#">{{ $data->product_name }}</a>
                        </h4>
                        <h5>{{ $data->product_price }}</h5>
                        <p class="card-text">{{ $data->product_description }}</p>
                    </div>
                    <div class="card-footer">
                        <small class="text-muted">&#9733; &#9733; &#9733; &#9733; &#9734;</small>
                    </div>
                </div>
            </div>
        @endforeach
    <!-- /.row -->
    </div>

这是输出:

from selenium import webdriver
from selenium.webdriver.comma.keys import Keys

driver = webdriver.Firefox()
driver.get("http://www.python.org")

1 个答案:

答案 0 :(得分:2)

尝试共同点:

from selenium.webdriver.common.keys import Keys
相关问题