I'm totally new to selenium and when I wrote this piece of code, I'm getting an error from chrome saying "chrome driver has stopped working" and it asks me to close chrome or not.
from selenium import webdriver
chrome_path="C:\Python27\Scripts\chromedriver.exe"
driver=webdriver.Chrome(chrome_path)
driver.get("https://www.google.com")
After I execute this line in my IDLE
driver=webdriver.Chrome(chrome_path)
Chrome opens but says "You are using unsupported command line flag: -- ignore-certificate-errors. Stability and security will suffer." and it pops up a dialog box telling me to "Disable developer mode extensions"
After I type this line
driver.get("https://www.google.com")
A dialog box appears saying chromedriver.exe has stopped working and it gives me a button to close program. Sometimes this doesn't appear straight away, I get some error on IDLE GUI like this. Click me for the error image
Few details :-
Chrome Version :- 60.0.3112.101
chromedriver version :- 2.9.248315
Python version :- 2.7.13
Please upgrade to the newest chromedriver version.
Link to chromedriver
Related
I've been asked to evaluate Robotframework and happy with what I've seen for the most part. For it to be a viable option for me however, I need it to work in Firefox.
Marionette capabilities were a problem in my Ruby/Capybara environment, and I was able to shut it off.
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :firefox, desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false))
end
Getting the same thing in Robot / Python 2.7 / ff44.0 has generated an error in either direction.
When marionette is on:
${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.FIREFOX sys, selenium.webdriver
Set To Dictionary ${dc} marionette=${True}
Open Browser ${url_bck_auto} Firefox desired_capabilities=${dc}
I get this:
Our products rock | FAIL |
WebDriverException: Message: Unsupported Marionette protocol version
2, required 3
If I turn it off, gecko bumps me to ff51.0.1(32-bit) and I get a different message:
Our products rock | FAIL |
WebDriverException: Message: Can't load the profile. Possible firefox
version mismatch. You must use GeckoDriver instead for Firefox 48+.
Profile Dir: c:\users\blah\appdata\local\temp\tmpqzlxha\webdriver-
py-profilecopy If you specified a log_file in the FirefoxBinary
constructor, check it for details.
Geckodriver is version 0.15.0
Any help will be appreciated, thanks!
On Windows 10 I'm running Robot Framework 3.0, Selenium2Library 1.8.0, Selenium 3.0.2 and when I start your example, or the simplified single open browser http://google.com I get the same result when using Gecko 0.15.0. The browser starts but does not move to the desired page. The driver closes successfully but the browser stays open.
When using the same setup, but downgrading Geckodriver to 0.14.0 the results change, and the browser behaves as expected. Loads the page and closes when Close Browser keyword is called.
So, I recommend downgrading to Geckodriver 0.14.0.
I've just started developing a new application using Flask and PyCharm as my IDE.
I've encountered a problem which is driving me crazy.
Here is the code. I'll spare use all the import part and so on, I'll show only the routes that cause problems.
#app.route("/")
def home():
return render_template("home.html")
#app.route("/login/")
def login():
return "foo"
The first route works without a problem. However on the first line of the second route, PyCharm gives me an error message '"#" or "def" expected'. This breaks the autoindent and the auto completion features.
But the code runs without a problem.
Can anyone tell me how to fix this?
Thank you
This is because PyCharm is not able to recognize the flask package or version.
Once you add new project to PyCharm -
Go to File menu item
Click on Settings option
This will open-up the pop-up window.
In the left-hand-side link list - click on the project name
Click on the Project Interpreter link
In the right-hand-side pane select Flask and related packages that your project needs and add/install the same.
What worked for me was (I was missing pycharm's python environment dependencies for python)
If you don't already have a requirements file for your project.
Navigate to your project & this on your command line (as I used a venv virtual environment):
(venv)$ pip freeze > requirements.txt
Then Open your pycharm and open the requirements file, wait a second or two and a pop up notification will show up at the top showing you are missing dependencies and will provide you a click here to install.
After that I had no issues.
I'm having trouble running some codes that import cx_Oracle in command line, though the same codes work in console. Is there anything else I will need to set up in order to get this to work via command line please?
Saved just one line of code "import cx_Oracle" as test.py.
Run this line in ide (Spyder), iPython Notebook => no issues
run this by opening a command line window from the same folder the .py file is saved in, and run python test.py and encounter the below:
import cx_Oracle
ImportError: DLL load failed: %1 is not a valid Win32 application.
Not sure if there is anything additional I will need to set up to run cx_Oracle via command line? Have tried all the suggestions on setting PATH, ORACLE_HOME, re-installing but could not get this to work. versions that i'm using are
Python: 2.7
cx_Oracle: cx_Oracle-5.1.3-11g.win-amd64-py2.7
instant client: 12.1.0.0
Windows: 7 Enterprise
I also found this kind of problem.
Look at "not a valid Win32 application" this sentence, so I decide to change cx_Oracle to cx_Oracle-5.1.3-11g.win-32-py2.7. Luckly, it does work.
I am about to begin a project with Shiny (by RStudio). When I try to install the shiny package using the console install.packages("shiny"), I get the following error message:
trying URL 'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/shiny_0.10.1.tgz'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL'http://cran.rstudio.com/bin/macosx/mavericks/contrib/3.1/shiny_0.10.1.tgz'
Warning in install.packages :
download of package ‘shiny’ failed
I have tried to install it from the drop down menu in RStudio but have encountered the same problem. Any thoughts as to what is going on?
I am working on Mac, with the latest version of Mavericks (R version is 3.1.1).
Thanks,
Brian
Try a different CRAN mirror. The error indicates that the file was not found on the CRAN server
chooseCRANmirror()
shiny has just been updated 2014-10-01 so the changes may not have propagated down to all mirrors yet.
I'm new to Macs (and quite new to Django) and I'm setting up an existing Django/MySQL site that uses Mercurial as a site package, on a new Macbook Pro.
All was going well during installation - no error messages. I installed the default versions of most packages from macports.
However when I try runserver, localhost shows the following error message:
ImportError at /
.../lib/python2.6/site-packages/mercurial/osutil.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
Please could anyone advise? I've tried typing the following at the terminal:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
but it didn't help.
I've gotten a similar error and a combination of two things helped me install Mercurial for OS X Lion. I'm running OS X 10.7.3.
First, there is a bug on line 455 of the setup.py script (at least for Mercurial 2.2.1, the version I tried). The line
version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()
should be replaced with
version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0]
Second, after I installed Mercurial (either by easy_install, Mac OS X binary installer, and compilation), I kept getting the following error message:
ImportError: dlopen(/Library/Python/2.7/site-packages/mercurial/osutil.so, 2): no suitable image found. Did find: /Library/Python/2.7/site-packages/mercurial/osutil.so: mach-o, but wrong architecture
However, after seeing this post, I noticed that
defaults read com.apple.versioner.python Prefer-32-Bit
outputs 1 on my system. However, running this command
defaults write com.apple.versioner.python Prefer-32-Bit -bool no
and then recompiling / installing mercurial resulted in a working executable for me at the end.
If everything from my comment checks out, try setting that Prefer-32-bit in an user environment variable instead of at the command line.
Edit this file: ~/.MacOSX/environment.plist
See:
http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html#//apple_ref/doc/uid/20002093-113982