Skip to content
KitploitKITPLOIT
أدواتعمليات الاستغلالالمدونة
Log in
إرسال
أدواتعمليات الاستغلالالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

الخلاصاتاتصالالخصوصية© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
selenium-wire — يوسّع روابط Selenium الخاصة بلغة Python ليمنحك القدرة على فحص الطلبات التي يرسلها المتصفح. | Kitploit
أدوات/GitHubGitHub/wkeeling/selenium-wire
بروكسيات الويب والاعتراضاختبار أمان APIجمع المعلوماتأمن الويباختبار الاختراقArchived
GitHubwkeeling/selenium-wire

selenium-wire

يوسّع روابط Selenium الخاصة بلغة Python ليمنحك القدرة على فحص الطلبات التي يرسلها المتصفح.

عرض المستودع
2.0k28022منذ 2 سنواتتمت المراجعة من قبل Kitploit

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة

لم يعد Selenium Wire قيد الصيانة. شكرًا لدعمكم ولكل مساهماتكم.

Selenium Wire

توسّع Selenium Wire أدوات ربط Selenium <https://www.selenium.dev/documentation/en/>_ بلغة Python لتمنحك إمكانية الوصول إلى الطلبات الأساسية التي يرسلها المتصفح. تكتب كودك بنفس الطريقة التي تستخدمها مع Selenium، لكنك تحصل على واجهات برمجة تطبيقات إضافية لفحص الطلبات والاستجابات وإجراء تغييرات عليها أثناء التنفيذ.

.. image:: https://github.com/wkeeling/selenium-wire/workflows/build/badge.svg :target: https://github.com/wkeeling/selenium-wire/actions

.. image:: https://codecov.io/gh/wkeeling/selenium-wire/branch/master/graph/badge.svg :target: https://codecov.io/gh/wkeeling/selenium-wire

.. image:: https://img.shields.io/badge/python-3.7%2C%203.8%2C%203.9%2C%203.10-blue.svg :target: https://pypi.python.org/pypi/selenium-wire

.. image:: https://img.shields.io/pypi/v/selenium-wire.svg :target: https://pypi.python.org/pypi/selenium-wire

.. image:: https://img.shields.io/pypi/l/selenium-wire.svg :target: https://pypi.python.org/pypi/selenium-wire

.. image:: https://pepy.tech/badge/selenium-wire/month :target: https://pepy.tech/project/selenium-wire

مثال بسيط~~~~~~~~~~~~~~

.. code:: python

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']
        )

Prints:

.. code:: bash

https://www.google.com/ 200 text/html; charset=UTF-8
https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png 200 image/png
https://consent.google.com/status?continue=https://www.google.com&pc=s&timestamp=1531511954&gl=GB 204 text/html; charset=utf-8
https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png 200 image/png
https://ssl.gstatic.com/gb/images/i2_2ec824b0.png 200 image/png
https://www.google.com/gen_204?s=webaft&t=aft&atyp=csi&ei=kgRJW7DBONKTlwTK77wQ&rt=wsrt.366,aft.58,prt.58 204 text/html; charset=UTF-8
...

Features


* Pure Python, user-friendly API
* HTTP and HTTPS requests captured
* Intercept requests and responses
* Modify headers, parameters, body content on the fly
* Capture websocket messages
* HAR format supported
* Proxy server support

Compatibilty
  • Python 3.7+
  • Selenium 4.0.0+
  • Chrome, Firefox, Edge and Remote Webdriver supported

Table of Contents

- `التثبيت`_

  * `إعداد المتصفح`_

  * `OpenSSL`_

- `إنشاء Webdriver`_

- `الوصول إلى الطلبات`_

- `كائنات الطلب`_

- `كائنات الاستجابة`_

- `اعتراض الطلبات والاستجابات`_

  * `مثال: إضافة ترويسة طلب`_
  * `مثال: استبدال ترويسة طلب موجودة`_
  * `مثال: إضافة ترويسة استجابة`_
  * `مثال: إضافة معامل طلب`_
  * `مثال: تحديث JSON في نص طلب POST`_
  * `مثال: المصادقة الأساسية`_
  * `مثال: حظر طلب`_
  * `مثال: محاكاة استجابة`_
  * `إلغاء تعيين معترض`_

- `تقييد التقاط الطلبات`_

- `تخزين الطلبات`_

  * `التخزين في الذاكرة`_

- `البروكسيات`_

  * `SOCKS`_

  * `التبديل الديناميكي`_

- `كشف البوتات`_

- `الشهادات`_

  * `استخدام شهادتك الخاصة`_

- `جميع الخيارات`_

- `الترخيص`_

التثبيت~~~~~~~~~~~~

Install using pip:

.. code:: bash

    pip install selenium-wire

If you get an error about not being able to build cryptography you may be running an old version of pip. Try upgrading pip with ``python -m pip install --upgrade pip`` and then re-run the above command.

Browser Setup
-------------

No specific configuration should be necessary except to ensure that you have downloaded the relevent webdriver executable for your browser and placed it somewhere on your system PATH.

- `Download <https://sites.google.com/chromium.org/driver/>`__ webdriver for Chrome
- `Download <https://github.com/mozilla/geckodriver/>`__ webdriver for Firefox
- `Download <https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/>`__ webdriver for Edge

OpenSSL
-------

Selenium Wire requires OpenSSL for decrypting HTTPS requests. This is probably already installed on your system (you can check by running ``openssl version`` on the command line). If it's not installed you can install it with:

**Linux**

.. code:: bash

    # For apt based Linux systems
    sudo apt install openssl

    # For RPM based Linux systems
    sudo yum install openssl

    # For Linux alpine
    sudo apk add openssl

**MacOS**

.. code:: bash

    brew install openssl

**Windows**

No installation is required.

Creating the Webdriver

تأكد من أنك تستورد webdriver من حزمة seleniumwire:

.. code:: python

from seleniumwire import webdriver

ثم قم بإنشاء مثيل لـ webdriver تمامًا كما تفعل إذا كنت تستخدم Selenium مباشرةً. يمكنك تمرير أي إمكانيات أو خيارات خاصة بالمتصفح ترغب بها - مثل مسار الملف التنفيذي أو الوضع بدون واجهة رسومية (headless) وغيرها. تمتلك Selenium Wire أيضًا own options_ التي يمكن تمريرها في سمة seleniumwire_options.

.. code:: python

# Create the driver with no options (use defaults)
driver = webdriver.Chrome()

# Or create using browser specific options and/or seleniumwire_options options
driver = webdriver.Chrome(
    options = webdriver.ChromeOptions(...),
    seleniumwire_options={...}
)

.. _own options: #all-options

لاحظ أنه بالنسبة للحزم الفرعية لـ webdriver، يجب أن تستمر في استيرادها مباشرةً من selenium. على سبيل المثال، لاستيراد WebDriverWait:

.. code:: python

# Sub-packages of webdriver must still be imported from `selenium` itself
from selenium.webdriver.support.ui import WebDriverWait

Webdriver عن بُعد

يوفّر Selenium Wire دعمًا محدودًا لاستخدام عميل webdriver البعيد. عند إنشاء مثيل لـ webdriver البعيد، تحتاج إلى تحديد اسم المضيف (hostname) أو عنوان IP للجهاز (أو الحاوية) الذي يشغّل Selenium Wire. يتيح ذلك للمثيل البعيد التواصل مرة أخرى مع Selenium Wire بطلباته واستجاباته.

.. code:: python

options = {
    'addr': 'hostname_or_ip'  # Address of the machine running Selenium Wire. Explicitly use 127.0.0.1 rather than localhost if remote session is running locally.
}
driver = webdriver.Remote(
    command_executor='http://www.example.com',
    seleniumwire_options=options
)

إذا كان الجهاز الذي يشغّل المتصفح بحاجة إلى استخدام عنوان مختلف للتواصل مع الجهاز الذي يشغّل Selenium Wire، فيتعيّن عليك تكوين المتصفح يدويًا. وتتناول هذه المشكلة <https://github.com/wkeeling/selenium-wire/issues/220>_ مزيدًا من التفاصيل.

الوصول إلى الطلبات~~~~~~~~~~~~~~~~~~

Selenium Wire captures all HTTP/HTTPS traffic made by the browser [1]_. The following attributes provide access to requests and responses.

driver.requests The list of captured requests in chronological order.

driver.last_request Convenience attribute for retrieving the most recently captured request. This is more efficient than using driver.requests[-1].

driver.wait_for_request(pat, timeout=10) This method will wait until it sees a request matching a pattern. The pat attribute will be matched within the request URL. pat can be a simple substring or a regular expression. Note that driver.wait_for_request() doesn't make a request, it just waits for a previous request made by some other action and it will return the first request it finds. Also note that since pat can be a regular expression, you must escape special characters such as question marks with a slash. A TimeoutException is raised if no match is found within the timeout period.

For example, to wait for an AJAX request to return after a button is clicked:

.. code:: python
تنزيل الأداة