Unable to launch selenium with python in mac

2024/10/9 16:27:15

I'm facing an issue with selenium with python in Mac OS.. Python 2.7 pydev 3.0

My sample code

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.formsite.com/")
driver.maximize_window()
driver.close()

Installed selenium using PIP

pip install selenium
Downloading/unpacking seleniumDownloading selenium-2.44.0.tar.gz (2.6MB): 2.6MB downloadedRunning setup.py (path:/private/var/folders/qw/ctlmndfd5ts9w2p6v1qc382r0000gn/T/pip_build_bhanusaa/selenium/setup.py) egg_info for package seleniumInstalling collected packages: seleniumRunning setup.py install for seleniumSuccessfully installed selenium

Assigned /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages in Python Path library enter image description here

getting below error

Traceback (most recent call last):File "/Users/bhanusaa/Desktop/samp/src/scripts/new.py", line 3, in <module>driver = webdriver.Firefox()File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__self.binary, timeout),File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__self.binary.launch_browser(self.profile)File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 65, in launch_browserself._start_from_profile_path(self.profile.path)File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 88, in _start_from_profile_pathenv=self._firefox_env).communicate()File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 711, in __init__errread, errwrite)File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1308, in _execute_childraise child_exception
OSError: [Errno 2] No such file or directory
Answer

HI the issue is resolved now, previously i had installed Firefox 34.0 in my Mac and now downgraded to 30.0, now it is working fine.

https://en.xdnf.cn/q/118560.html

Related Q&A

Memory error In instantiating the numpy array

I have a list A of a 50,000 elements and each element is an array of shape (102400) I tried instantiating an array B.B=numpy.array(A)But this throws an exception MemoryError.I know that the memory and …

Setting column names in a pandas dataframe (Python)

When setting a column name for a pandas dataframe, why does the following work:df_coeff = pd.DataFrame(data = lm.coef_, index = X.columns, columns = [Coefficient])While this does not workdf_coeff = pd.…

Check that Python function does not modify argument?

You know how in Python, if v is a list or a dictionary, its quite common to write functions that modify v in place (instead of just returning the new value). Im wondering if it is possible to write a c…

What Python 3 version for my Django project

I will try to port my Python 2.7 with Django to Python 3. But now my question is what version is the most stable one today? Ive heard people use 3.2 and 3.4 and recommend it. But now Im asking you guy…

Error during runfile in Eclipse with PyDev/ error initializing console

Using a PyDev console in Eclipse, which initially worked fine. Python code would work inside the console. When I started writing a file within a PyDev module, I tried executing runfile() but the consol…

Reversibly encode two large integers of different bit lengths into one integer

I want to encode two large integers of possibly different maximum bit lengths into a single integer. The first integer is signed (can be negative) whereas the second is unsigned (always non-negative). …

Pytube AttributeError: NoneType object has no attribute span

Hi I have a problem with AttributeError: NoneType object has no attribute span I read on the StackOverflow a channel with this problem on this I found the potential solution but it still not working he…

GDB: ModuleNotFoundError: No module named _tkinter [duplicate]

This question already has answers here:Why does tkinter (or turtle) seem to be missing or broken? Shouldnt it be part of the standard library?(4 answers)Closed last year.So Im trying to debug my C co…

Why can the difference of different floating numbers be 0 in python? [duplicate]

This question already has answers here:Float to Int type conversion in Python for large integers/numbers(2 answers)Closed last year.Why is the result of below code 0 in python3? a = "4.1512940685…

twinx and sns.barplot seaborn are overlapping bars

I would like to use sns.seaborn to display the np.sum and the np.mean on 2 different axes (with ax2 = ax1.twinx() I assume). The probem I have is that the graphs are overlapped and not readable.Am I ap…