草庐IT

Webdriver-manager

全部标签

python - 找不到 manage.py collectstatic 命令,Django 1.5.1

我是python的新手,当我运行$pythonmanage.pycollectstatic命令,返回'未知命令:'collectstatic''根据我的研究发现,settings.py似乎有问题,这是我的settings.py:importosDEBUG=TrueTEMPLATE_DEBUG=DEBUGADMINS=(#('','your_email@example.com'),)MANAGERS=ADMINSDATABASES={'default':{'ENGINE':'django.db.backends.sqlite3','NAME':'basic_code.sqlite3',#

python - Scrapy with selenium, webdriver 无法实例化

我正在尝试将selenium/phantomjs与scrapy一起使用,但我遇到了很多错误。例如,采用以下代码片段:defparse(self,resposne):whileTrue:try:driver=webdriver.PhantomJS()#dosomestuffdriver.quit()breakexcept(WebDriverException,TimeoutException):try:driver.quit()exceptUnboundLocalError:print"Driverfailedtoinstantiate"time.sleep(3)continue很多时候

python - Pycharm manage.py 自动完成错误

我正在使用Django1.10和Pycharm2016.2.在每个Django项目中,manage.py命令都可以正常工作,但自动完成会出现以下错误:Failedtogetrealcommandsonmodule"projects_name"pythondiedwithcode1Fileopt/Pycharm/helpers/.../jb_manage_tasks_provider.pyFileopt/pycharm/helpers.../parser.pyFilemyvirtualenvfolder/lib/python3.5/sitepackages/django/core/man

python - 无法使用 python ./manage.py dumpdata app 转储数据

我在Django项目中创建了一个应用程序。出于测试目的,我想创建fixture文件。我发现我可以转储我的数据库,以便在它已经有数据的情况下自动创建fixture。我想使用fixture,所以我使用了命令python./manage.pydumpdataapp,但它返回了一个包含大量\x02的列表。但是如果我使用python./manage.pyauth它运行完美。知道为什么我的dumpdata只显示\x02。提前致谢。我附上以下链接的截图:http://www.cs.ait.ac.th/~fon/wp-content/uploads/2011/01/Screenshot.png

python - 无法在python中的selenium webdriver中加载firefox

我已经安装了Python3.6.2,Selenium3.5.0和GeckoDriver0.18.0,Firefox版本在Windows7上是54.0.1。火狐版本错误。请让我知道问题出在哪里。下面是代码和错误信息。fromseleniumimportwebdriverfromselenium.webdriver.common.keysimportKeysfromselenium.webdriver.firefox.firefox_binaryimportFirefoxBinarycapabilities=webdriver.DesiredCapabilities().FIREFOXca

python - 在 python 中使用默认的 firefox 配置文件和 selenium webdriver

我知道以前有人问过类似的问题,但我已经尝试了很多次,但仍然对我不起作用。我在firefox中只有一个默认配置文件(称为c1r3g2wi.default),没有其他配置文件。当我使用seleniumwebdriver启动它时,我希望我的firefox浏览器以这个配置文件启动。我如何在Python中执行此操作?我这样做了:fp=webdriver.FirefoxProfile('C:\Users\admin\AppData\Roaming\Mozilla\Firefox\Profiles\c1r3g2wi.default')browser=webdriver.Firefox(fp)但是我得

python - django_openid_auth TypeError openid.yadis.manager.YadisServiceManager 对象不是 JSON 可序列化的

我在我的项目中使用了django_openid_auth,它在一段时间内运行良好。但是今天,我测试了应用程序并遇到了这个异常:Environment:RequestMethod:GETRequestURL:http://localhost:7777/google/login/DjangoVersion:1.6PythonVersion:2.7.3InstalledApplications:('django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.sites

Python selenium webdriver - 驱动程序突然出现 "dies"并且无法退出,获取 current_url,打开页面

有时,在我的脚本中间,我的webdriver实例会死掉!从那以后,我无法调用它的任何方法。一些例子:>>>spsel.driver.current_urlTraceback(mostrecentcalllast):File"",line1,inFile"/usr/local/lib/python2.6/dist-packages/selenium/webdriver/remote/webdriver.py",line414,incurrent_urlreturnself.execute(Command.GET_CURRENT_URL)['value']File"/usr/local/l

python - 使用 selenium webdriver 限制 phantomjs 的内存使用?

我在远程WebDriver模式下使用phantomjs--webdriver8910运行phantomjs,然后使用Seleniumpython绑定(bind)获取许多页面,例如:wd=webdriver.PhantomJS(port=8910)forurlinbig_url_list:wd.get(url)#dosomethinghere,e.g.wd.save_screenshotorprintwd.page_sourcewd.quit()wd.quit()似乎什么都不做。使用top监控进程显示,随着检索更多页面,phantomjs进程的内存使用量持续增加。如果我重新启动phant

python - 在 Google 应用引擎的 django-nonrel 中使用 manage.py 时出现异常 AttributeError 消息

我正在使用Python2.7和django-nonrel用于在Google应用引擎上运行Django项目。我使用的是Google应用引擎SDK的1.6版。我运行pythonmanage.pysyncdb或pythonmanage.pydeploy。命令完成后,我收到以下消息:ExceptionAttributeError:"'NoneType'objecthasnoattribute'mkstemp'"in>ignored为什么我会收到这条消息,有什么办法可以解决吗? 最佳答案 已经报道过了。参见this.显然,它不会破坏任何东西。