git: 52bdbca404f7 - main - www/py-selenium-wire: New port - extends Selenium

From: Dan Langille <dvl_at_FreeBSD.org>
Date: Wed, 30 Nov 2022 20:33:49 UTC
The branch main has been updated by dvl:

URL: https://cgit.FreeBSD.org/ports/commit/?id=52bdbca404f75a0c0d6e2acdf4492dc4d78e7c24

commit 52bdbca404f75a0c0d6e2acdf4492dc4d78e7c24
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2022-11-30 20:32:24 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2022-11-30 20:32:24 +0000

    www/py-selenium-wire: New port - extends Selenium
    
    Selenium Wire extends Selenium's Python bindings to give you access to
    the underlying requests made by the browser. You author your code in the
    same way as you do with Selenium, but you get extra APIs for inspecting
    requests and responses and making changes to them on the fly.
---
 www/Makefile                   |  1 +
 www/py-selenium-wire/Makefile  | 33 +++++++++++++++++++++++++++++++++
 www/py-selenium-wire/distinfo  |  3 +++
 www/py-selenium-wire/pkg-descr | 23 +++++++++++++++++++++++
 4 files changed, 60 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index da08be411f75..f91a4fb40138 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1748,6 +1748,7 @@
     SUBDIR += py-secure-cookie
     SUBDIR += py-selector
     SUBDIR += py-selenium
+    SUBDIR += py-selenium-wire
     SUBDIR += py-semiphemeral
     SUBDIR += py-sentinelhub
     SUBDIR += py-slimit
diff --git a/www/py-selenium-wire/Makefile b/www/py-selenium-wire/Makefile
new file mode 100644
index 000000000000..85aa5a2316b1
--- /dev/null
+++ b/www/py-selenium-wire/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	selenium-wire
+PORTVERSION=	5.1.0
+CATEGORIES=	www python
+MASTER_SITES=	CHEESESHOP
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	dvl@FreeBSD.org
+COMMENT=	Access to the underlying Selenium requests
+WWW=		https://github.com/wkeeling/selenium-wire
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}blinker>=1.4:devel/py-blinker@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}brotli>=1.0.9:archivers/py-brotli@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}certifi>=2019.9.1:security/py-certifi@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}h2>=4.0:www/py-h2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}hyperframe>=6.0:www/py-hyperframe@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}kaitaistruct>=0.7:devel/py-kaitaistruct@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}openssl>=19.1.0:security/py-openssl@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyasn1>=0.3.1:devel/py-pyasn1@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pyparsing>=2.4.2:devel/py-pyparsing@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pysocks>=1.7.1:net/py-pysocks@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}selenium>=3.4.0:www/py-selenium@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wsproto>0.14:net/py-wsproto@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}zstandard>=0.14.1:archivers/py-zstandard@${PY_FLAVOR}
+
+USES=		python:3.6+
+USE_PYTHON=	autoplist distutils
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/www/py-selenium-wire/distinfo b/www/py-selenium-wire/distinfo
new file mode 100644
index 000000000000..8a4f0ab9fd2b
--- /dev/null
+++ b/www/py-selenium-wire/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1668705655
+SHA256 (selenium-wire-5.1.0.tar.gz) = b1cd4eae44d9959381abe3bb186472520d063c658e279f98555def3d4e6dd29b
+SIZE (selenium-wire-5.1.0.tar.gz) = 62145825
diff --git a/www/py-selenium-wire/pkg-descr b/www/py-selenium-wire/pkg-descr
new file mode 100644
index 000000000000..131becc04556
--- /dev/null
+++ b/www/py-selenium-wire/pkg-descr
@@ -0,0 +1,23 @@
+Selenium Wire extends Selenium's Python bindings to give you access to the
+underlying requests made by the browser. You author your code in the same way as
+you do with Selenium, but you get extra APIs for inspecting requests and
+responses and making changes to them on the fly.
+
+Simnple example:
+
+from seleniumwire import webdriver  # Import from seleniumwire
+
+# Create a new instance of the Chrome driver
+driver = webdriver.Chrome()
+
+# Go to the Google home page
+driver.get('https://www.google.com')
+
+# Access requests via the `requests` attribute
+for request in driver.requests:
+    if request.response:
+        print(
+            request.url,
+            request.response.status_code,
+            request.response.headers['Content-Type']
+        )