-
Notifications
You must be signed in to change notification settings - Fork 56
Description
On a current Mac, poetry installed via Homebrew fails:
$ poetry install
Command ['/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/bin/python3.12', '-I', '-W', 'ignore', '-c', 'import sys\n\nif hasattr(sys, "real_prefix"):\n print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n print(sys.base_prefix)\nelse:\n print(sys.prefix)\n'] errored with the following return code -10
A PHP implementation would be desirable to obtain structured information (SI) as well as the current (AD) and chronological excerpt (CD) for a given legal entity.
With the Laravel framework, either Laravel's HTTP client powered by Guzzle might be used, or Laravel Dusk using a Selenium compatible driver if JavaScript is required. Unfortunately, this seems to be the case.
Both a request with curl (curl -d "registerArt_input=VR" -d "registerNummer=304" -d "registergericht_input=D2601" https://www.handelsregister.de/rp_web/erweitertesuche.xhtml) as well as a request with Laravel's HTTP client (obtaining the cookie in a first request, then reusing this cookie requesting the extended search form) fails with the error message "session expired".
Test using PHP Pest:
use Illuminate\Support\Facades\Http;
it('makes a request at handelsregister.de',
closure: function () {
$response = Http::get('https://www.handelsregister.de');
// https://stackoverflow.com/a/70330475
$cookie_value = $response->cookies->getCookieByName('JSESSIONID')->getValue();
dump($cookie_value);
// Advanced search
$response = Http::withCookies(['JSESSIONID' => $cookie_value],
'www.handelsregister.de')->get('https://www.handelsregister.de/rp_web/welcome.xhtml#');
dump($response);
});
It's a shame that the German federal services don't offer a proper API.
Also, a rate limit of 60 requests per hour is ridiculous for publicly available data.