problem running python script with Selenium wrong parameter - selenium

Good morning, since a few days I have this problem when I run my script in python, until two days ago it was working now it doesn't work anymore, and I can't understand what is the problem...
I attach error code and imports.
Thanks
2022-07-14 15:49:04,691 INFO Your selenium-driver-updater library is up to date.
2022-07-14 15:49:05,756 INFO Latest version of edgedriver: 103.0.1264.51
2022-07-14 15:49:05,756 INFO Started download edgedriver latest_version: 103.0.1264.51
2022-07-14 15:49:05,756 INFO Started download edgedriver by url: https://msedgedriver.azureedge.net/103.0.1264.51/edgedriver_win64.zip
2022-07-14 15:49:06,882 ERROR error: Traceback (most recent call last):
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium_driver_updater\driverUpdater.py", line 133, in install
driver_path = DriverUpdater.__run_specific_driver()
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium_driver_updater\driverUpdater.py", line 339, in __run_specific_driver
driver_path = driver.main()
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium_driver_updater\_edgeDriver.py", line 54, in main
driver_path = self.__check_if_edgedriver_is_up_to_date()
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium_driver_updater\_edgeDriver.py", line 80, in __check_if_edgedriver_is_up_to_date
driver_path = self._download_driver()
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium_driver_updater\_edgeDriver.py", line 187, in _download_driver
archive_path = wget.download(url=url, out=out_path)
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\wget.py", line 526, in download
(tmpfile, headers) = ulib.urlretrieve(binurl, tmpfile, callback)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 239, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 523, in open
response = meth(req, response)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 632, in http_response
response = self.parent.error(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 561, in error
return self._call_chain(*args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 494, in _call_chain
result = func(*args)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\urllib\request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
c:\Users\diriy\OneDrive\Python\Monatseinteilung\Monatseint_Tool_v3.104.py:65: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
driver = webdriver.Edge(filename, options=options)
Traceback (most recent call last):
File "c:\Users\diriy\OneDrive\Python\Monatseinteilung\Monatseint_Tool_v3.104.py", line 65, in <module>
driver = webdriver.Edge(filename, options=options)
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\edge\webdriver.py", line 61, in __init__
super().__init__(DesiredCapabilities.EDGE['browserName'], "ms",
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\chromium\webdriver.py", line 89, in __init__
self.service.start()
File "C:\Users\diriy\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\selenium\webdriver\common\service.py", line 71, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 87] Wrong paramater

Related

Error with fetching chromium with fetch command

When I try to fetch chromium with the command it gives me a whole bunch of errors and at the end says "FileNotFoundError: [WinError 2] The system cannot find the file specified"
After the error occurred (output bellow) I tried to add the DEPOT_TOOLS_WIN_TOOLCHAIN to the system environment variables but after a restart nothing happened. Does anyone have a solution to this?
Error Output:
[0:00:00] Started.
Traceback (most recent call last):
File "C:\src\depot_tools\metrics.py", line 301, in print_notice_and_exit
yield
File "C:\src\depot_tools\gclient.py", line 3495, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\src\depot_tools\gclient.py", line 3481, in main
return dispatcher.execute(OptionParser(), argv)
File "C:\src\depot_tools\subcommand.py", line 252, in execute
return command(parser, args[1:])
File "C:\src\depot_tools\gclient.py", line 3032, in CMDsync
ret = client.RunOnDeps('update', args)
File "C:\src\depot_tools\gclient.py", line 2026, in RunOnDeps
work_queue.flush(revision_overrides,
File "C:\src\depot_tools\gclient_utils.py", line 1016, in flush
reraise(e[0], e[1], e[2])
File "C:\src\depot_tools\gclient_utils.py", line 70, in reraise
raise value
File "C:\src\depot_tools\gclient_utils.py", line 1093, in run
self.item.run(*self.args, **self.kwargs)
File "C:\src\depot_tools\gclient.py", line 1005, in run
self._got_revision = self._used_scm.RunCommand(command, options, args,
File "C:\src\depot_tools\gclient_scm.py", line 128, in RunCommand
return getattr(self, command)(options, args, file_list)
File "C:\src\depot_tools\gclient_scm.py", line 610, in update
mirror = self._GetMirror(url, options, revision, revision_ref)
File "C:\src\depot_tools\gclient_scm.py", line 1060, in _GetMirror
if not self.cache_dir:
File "C:\src\depot_tools\gclient_scm.py", line 225, in cache_dir
return git_cache.Mirror.GetCachePath()
File "C:\src\depot_tools\git_cache.py", line 193, in GetCachePath
cachepath = subprocess.check_output(
File "C:\src\depot_tools\.cipd_bin\3.8\bin\Lib\subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\src\depot_tools\.cipd_bin\3.8\bin\Lib\subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\src\depot_tools\.cipd_bin\3.8\bin\Lib\subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\src\depot_tools\.cipd_bin\3.8\bin\Lib\subprocess.py", line 1311, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Subprocess failed with return code 1.
You should delete config DEPOT_TOOLS_UPDATE on environment.

meson wrap URLError

1、system
win10
2、shell window
mingw msys
3、python version
3.6
4、meson version
0.61.5
After install meson by cmd "pip3 install --user meson", I run cmd "meson wrap list", the wrong occurs. it report the error "SSL: CERTIFICATE_VERIFY_FAILED", more details as following:
$ meson wrap list
Traceback (most recent call last):
File "d:\app\python3\lib\urllib\request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "d:\app\python3\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "d:\app\python3\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "d:\app\python3\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "d:\app\python3\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "d:\app\python3\lib\http\client.py", line 964, in send
self.connect()
File "d:\app\python3\lib\http\client.py", line 1400, in connect
server_hostname=server_hostname)
File "d:\app\python3\lib\ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "d:\app\python3\lib\ssl.py", line 817, in __init__
self.do_handshake()
File "d:\app\python3\lib\ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "d:\app\python3\lib\ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\mesonmain.py", line 148, in run
return options.run_func(options)
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\wrap\wraptool.py", line 223, in run
options.wrap_func(options)
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\wrap\wraptool.py", line 66, in list_projects
releases = get_releases()
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\wrap\wraptool.py", line 62, in get_releases
url = urlopen('https://wrapdb.mesonbuild.com/v2/releases.json')
File "d:\app\python3\lib\urllib\request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "d:\app\python3\lib\urllib\request.py", line 526, in open
response = self._open(req, data)
File "d:\app\python3\lib\urllib\request.py", line 544, in _open
'_open', req)
File "d:\app\python3\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "d:\app\python3\lib\urllib\request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "d:\app\python3\lib\urllib\request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>
ERROR: Unhandled python exception
This is a Meson bug and should be reported!
my browser can access the https link, I find some similar problems as this, but no the same environment as me, is this a new bug? if so, how to fix it?

Python 3.8 Downloading Packages/Modules error using PIP

I am trying to install numpy but it is giving this error please help what should I do ?
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher
yield
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\commands\install.py", line 331, in run
resolver.resolve(requirement_set)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 480, in prepare_linked_requirement
local_path = unpack_url(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in unpack_url
return unpack_http_url(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 158, in unpack_http_url
from_path, content_type = _download_http_url(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 303, in _download_http_url
for chunk in download.chunks:
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\utils\ui.py", line 160, in iter
for x in it:
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\network\utils.py", line 15, in response_chunks
for chunk in response.raw.stream(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
Look directly at the last line :
Read timed out
Connect to wifi or faster internet and try again.
my internet connection was poor then i got this error. Then i tried it with faster connection and it worked for me...

using selenium from pythonanywhere?

I want use selenium in pythonanywhere.
this is error log in pythonanywhere.
Traceback (most recent call last):
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 2000, in __call__
return self.wsgi_app(environ, start_response)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1991, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1567, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/downtownhub/odermysite/minitwit.py", line 409, in ordercolect
driver = webdriver.Firefox()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 135, in __init__
self.service.start()
File "/home/downtownhub/odermysite/env/lib/python3.4/site-packages/selenium/webdriver/common/service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
So I added geckodrive file in Path('/home/downtownhub/odermysite/env/bin').
but it happen same error.
what can I solve it??
Ah, I see you're using a virtualenv. PythonAnywhere uses an old version of Firefox (v17) which is not compatible with the latest selenium/geckodriver. Switch back to selenium 2:
./env/bin/pip install "selenium<3"

Scrapyd S3 feed export "Connection Reset by Peer"

I'm running Scrapyd with a FEED_URI set to export to S3, but I received the following error at the very end of my scrape. Note that it successfully uploaded a few hundred kb of data to the bucket as the scrape began, then threw this error at the end:
2014-11-24 10:11:23+0000 [word] ERROR: Error storing csv feed (2285242 items) in: s3://kitchen.bucket/FoodItem.csv
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
self.__bootstrap_inner()
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 191, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/usr/local/lib/python2.7/dist-packages/scrapy/contrib/feedexport.py", line 101, in _store_in_thread
key.set_contents_from_file(file)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 1291, in set_contents_from_file
chunked_transfer=chunked_transfer, size=size)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 748, in send_file
chunked_transfer=chunked_transfer, size=size)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 949, in _send_file_internal
query_args=query_args
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 664, in make_request
retry_handler=retry_handler
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1068, in make_request
retry_handler=retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 939, in _mexe
request.body, request.headers)
File "/usr/local/lib/python2.7/dist-packages/boto/s3/key.py", line 842, in sender
http_conn.send(chunk)
File "/usr/lib/python2.7/httplib.py", line 805, in send
self.sock.sendall(data)
File "/usr/lib/python2.7/ssl.py", line 329, in sendall
v = self.send(data[count:])
File "/usr/lib/python2.7/ssl.py", line 298, in send
v = self._sslobj.write(data)
socket.error: [Errno 104] Connection reset by peer
Looks similar to boto issue 2207. I'm using gbirke's MultiFeedExporter, and received a similar error on both of my items.