From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gP+3LM98hWEr3wAAgWs5BA (envelope-from ) for ; Fri, 05 Nov 2021 19:49:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aGJYKM98hWFkawAAB5/wlQ (envelope-from ) for ; Fri, 05 Nov 2021 18:49:51 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F1F488DDC for ; Fri, 5 Nov 2021 19:49:50 +0100 (CET) Received: from localhost ([::1]:41160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mj4Hd-000269-0m for larch@yhetil.org; Fri, 05 Nov 2021 14:49:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj4Gh-00024Q-HV for help-guix@gnu.org; Fri, 05 Nov 2021 14:48:54 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:41677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mj4Gg-0002og-1p for help-guix@gnu.org; Fri, 05 Nov 2021 14:48:51 -0400 Received: by mail-qt1-x82d.google.com with SMTP id v4so8015743qtw.8 for ; Fri, 05 Nov 2021 11:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=A8hgFgku03l2n0EmptyTJlKZ8VMiIzK7q3zA0Khk1wI=; b=azZBiv2jsN0sc5WalJkPZf2j0CnV7hjD7cEaqHMoh4b0bh5NMeyDfOGjaq0ZUGbwhH Og2BwjZr0bIjY6is7PUfQWaZppy63A/kksGCDwGan9O27kXfOzeqQFIs3aU40FKfqxb/ lEuj5+Nmbx/IRJxyLl8DtLQAuwHwKetN+nlzw9MxoynXHnOu6+P2uALbPlORQiVZl2CB bciKFH/Ryv6Mu0pZs42B1XhDX33cAovmbAnhIexZW3SqvUV/gihQwiXPX+5LeAGhnUjq LFNZTEqxsuP3EEfYCyx2ZeuBPJ3uMXLaXEdgfWIScif/YNtlgv1aIk7ogp+iZQARSwJp p/Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=A8hgFgku03l2n0EmptyTJlKZ8VMiIzK7q3zA0Khk1wI=; b=BNpV6mHcCmtYDFhOlc7CiuqM807lhQPCooI/c3ew5po0QsV8QqtgC+W02JmOB+pGJc hemsqN8rEpeKDnLcC8AwopFMsikZU9iTfc71ZhfsdTs5V1alXd5sGTwDKV6weACnb0uk DfiEv/6rv/gohCC0fB+99IPcIfq7ozepN4hHk8kjkRKOCOflNJ9yHQpft36vcZDciiI1 ERu3LbHzjqCamnF5PFx7KS52eDG0eJyM+BhWM79X8EogDMHyQhsXrrmydY3gRHuM4HZN o36aFibDTlIMJn6Dre5JZb09qUbUtrSFhgAG8/OOfohJAjbtUuCtvA/s3OZys9ProShe GuFg== X-Gm-Message-State: AOAM531rPKOJc4pu8EdoN/CaAvHQp6sfBkDMibfNn8t6geKww2mkoT21 Ihms4x2XCj+BZLmv92ViGjYHiRG4o/xVpw== X-Google-Smtp-Source: ABdhPJxvKuIXEqd7yo66q0qXebAtz1A7mlZ4gD5FJlZ+hfm0Uh0F+GiDqkV1vI4VTVItwsVSyUBTww== X-Received: by 2002:ac8:7d09:: with SMTP id g9mr7618651qtb.241.1636138128698; Fri, 05 Nov 2021 11:48:48 -0700 (PDT) Received: from hurd (dsl-156-19.b2b2c.ca. [66.158.156.19]) by smtp.gmail.com with ESMTPSA id v18sm249009qta.56.2021.11.05.11.48.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 11:48:48 -0700 (PDT) From: Maxim Cournoyer To: help-guix Subject: Using IceCat/geckodriver with Selenium (Python) Date: Fri, 05 Nov 2021 14:48:46 -0400 Message-ID: <87mtmi30c1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::82d; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x82d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636138191; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=A8hgFgku03l2n0EmptyTJlKZ8VMiIzK7q3zA0Khk1wI=; b=sIMQjuTESqsY6LCcA/rxRYkoNFKvRCtFmCTsm4inHiFXRYwdEnSXwFyrMb/iqNd1ZV/PK0 8G0vgSBI7x45/JenHzymvPfEgU4YW8HFZyG5nU/lEo9Q+NKYfJJVaZQrRZX1Oipy2VNCAL RzJVVwwHlxpcwTLiyVJHFbolOThyfIMEZYDohLUQj6cPpUQUUDPZ4/LfsZdMP7Bm/1Ckai 8pzFXVrJBpLp8pgnpB6kdJI9eXqWlXRFAkb6xSGlqvSbbqzAXTjh+k9L7mRyhpqfWnGNKq ztM7q36sMwcBvYtv+vOjw5nVRGTde4fuBDq3PdFelHJaAZEjZly6ElHpyBHP+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636138191; a=rsa-sha256; cv=none; b=hKojm2ZcE6r94aPlASIDVFBjOfKLpLM3AQnAzWSRUqxS26VMG4ryKGIrd0rt4WjoecFhft 4k4XxBpF7IbzPahuGZXiWZUYl9B+r1eCqybPIxxfakb+ecFbmhswWCGqGDhGAF1piX0Q37 yr0+ZTTpmdjEoAyJ5KDmSbqHzkhaOBg4Q4tvtY8ntrXM2y4AocewDgiD6hr7X8X7Ulr9Pu uFCche5XS/y971fir0r4LO63KZWHvwZyhQBTWkHAgfERl4J0FQjbGa3bDK148Dqb74WYaZ QWRpwnf4dNg+XHPj7ObuvhySUrB1Ovtr1V4Dw5M9NIYFr1OS9DpL3FSVoOBVIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=azZBiv2j; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=azZBiv2j; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: F1F488DDC X-Spam-Score: -1.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: GfVyZIyTbYJn Hello, I'm sharing this bit of knowledge as it was not obvious at all. Selenium is hard-coded to look for 'firefox' in a couple places, even in the serialized settings it sends to the browser instance controlled by geckodriver. Here's the initialization that worked using Guix on the core-updates-frozen-batched-changes branch (where 'geckodriver' was recently added to IceCat): --8<---------------cut here---------------start------------->8--- from selenium.webdriver import Firefox, FirefoxOptions # Monkey patch the KEY string for IceCat. FirefoxOptions.KEY = "moz:icecatOptions" options = FirefoxOptions() options.headless = False options.binary = 'icecat' options.set_capability('browserName', 'icecat') self.driver = Firefox(options=options)# TODO: --8<---------------cut here---------------end--------------->8--- The non-obvious was monkey patching the 'moz:icecatOptions' string of the FirefoxOptions object, and having to set the 'browserName' capability; otherwise a capability/invalid argument execption would be raised. If you use chromedriver (included with) our ungoogled-chromium instead, it is more straightforward as there is nothing to rename/monkey patch: --8<---------------cut here---------------start------------->8--- options = ChromeOptions() options.headless = False self.driver = Chrome(options=options) --8<---------------cut here---------------end--------------->8--- I hope that helps someone else :-). Maxim