mirror of
https://github.com/probberechts/soccerdata.git
synced 2026-04-25 18:15:58 +03:00
[GH-ISSUE #780] [FotMob] Failed to establish new connection #165
Labels
No labels
ESPN
FBref
FotMob
MatchHistory
SoFIFA
Sofascore
WhoScored
WhoScored
bug
build
common
dependencies
discussion
documentation
duplicate
enhancement
good first issue
invalid
performance
pull-request
question
question
removal
understat
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/soccerdata#165
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tobias199822 on GitHub (Jan 6, 2025).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/780
Describe the bug
I want to scrape soccer data and my scraping code, that works for months, doesn't work now.
Affected scrapers
This affects the following scrapers:
Code example
A minimal code example that fails. Use
no_cache=Trueto make sure an invalid cached file does not cause the bug and make sure you have the latest version of soccerdata installed.Error message
Traceback (most recent call last):
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py", line 198, in _new_conn
sock = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
raise err
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 793, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 496, in _make_request
conn.request(
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py", line 400, in request
self.endheaders()
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1314, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1074, in _send_output
self.send(msg)
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\http\client.py", line 1018, in send
self.connect()
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py", line 238, in connect
self.sock = self._new_conn()
^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py", line 213, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002B3B0517290>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='46.101.91.154', port=6006): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002B3B0517290>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\soccerdata\fotmob.py", line 85, in _init_session
r = requests.get("http://46.101.91.154:6006/")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='46.101.91.154', port=6006): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002B3B0517290>: Failed to establish a new connection: [WinError 10061] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tobia\OneDrive\Dokumente\Steuern_allgemein\Python_Projekte\API_Soccerdata\Bundesliga_FotMob2SQLSERVER.py", line 22, in
fotmob = FotMob(leagues='GER-Bundesliga', seasons=[23, 24, 25], proxy=tor_proxy, data_dir= path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\soccerdata\fotmob.py", line 69, in init
super().init(
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\soccerdata_common.py", line 505, in init
self._session = self._init_session()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tobia\AppData\Local\Programs\Python\Python312\Lib\site-packages\soccerdata\fotmob.py", line 88, in _init_session
raise ConnectionError("Unable to connect to the session cookie server.")
ConnectionError: Unable to connect to the session cookie server.```