# Path: xpaw/http.py
# class HttpRequest:
# class HttpResponse:
#     def __init__(self, url, method="GET", body=None, params=None, headers=None, proxy=None,
#                  timeout=20, verify_ssl=False, allow_redirects=True, auth=None, proxy_auth=None,
#                  priority=None, dont_filter=False, callback=None, errback=None, meta=None,
#                  render=None):
#     def __str__(self):
#     def meta(self):
#     def copy(self):
#     def replace(self, **kwargs):
#     def to_dict(self):
#     def from_dict(cls, d):
#     def __init__(self, url, status, body=None, headers=None,
#                  request=None, encoding=None):
#     def __str__(self):
#     def encoding(self):
#     def encoding(self, value):
#     def text(self):
#     def meta(self):
#     def copy(self):
#     def replace(self, **kwargs):


import asyncio
import logging
from threading import Thread
from collections import deque
from selenium.webdriver import Chrome, ChromeOptions
from .http import HttpResponse, HttpHeaders
        if experimental_options is None:
            experimental_options = {}
        if 'prefs' not in experimental_options:
            experimental_options['prefs'] = self.default_prefs
        else:
            for k, v in self.default_prefs.items():
                experimental_options['prefs'].setdefault(k, v)
        for k, v in experimental_options.items():
            chrome_options.add_experimental_option(k, v)
        return chrome_options

    def create_driver_instance(self, name):
        driver = Chrome(options=self.options[name])
        self._set_navigator(driver)
        return DriverInstance(name, driver)

    def _set_navigator(self, driver):
        source = """Object.defineProperties(navigator,{webdriver:{get:()=> undefined}});"""
        add_script_to_evaluate_on_new_document(source, driver)

    def get_driver_name(self, request):
        if isinstance(request.render, str):
            name = request.render
        else:
            name = 'default'
        return name

    def get_driver_instance(self, request):
        name = self.get_driver_name(request)
        try:

# Path: xpaw/http.py
# class HttpRequest:
# class HttpResponse:
#     def __init__(self, url, method="GET", body=None, params=None, headers=None, proxy=None,
#                  timeout=20, verify_ssl=False, allow_redirects=True, auth=None, proxy_auth=None,
#                  priority=None, dont_filter=False, callback=None, errback=None, meta=None,
#                  render=None):
#     def __str__(self):
#     def meta(self):
#     def copy(self):
#     def replace(self, **kwargs):
#     def to_dict(self):
#     def from_dict(cls, d):
#     def __init__(self, url, status, body=None, headers=None,
#                  request=None, encoding=None):
#     def __str__(self):
#     def encoding(self):
#     def encoding(self, value):
#     def text(self):
#     def meta(self):
#     def copy(self):
#     def replace(self, **kwargs):


# Path: xpaw/renderer.py
import asyncio
import logging
from threading import Thread
from collections import deque
from selenium.webdriver import Chrome, ChromeOptions
from .http import HttpResponse, HttpHeaders

        if experimental_options is None:
            experimental_options = {}
        if 'prefs' not in experimental_options:
            experimental_options['prefs'] = self.default_prefs
        else:
            for k, v in self.default_prefs.items():
                experimental_options['prefs'].setdefault(k, v)
        for k, v in experimental_options.items():
            chrome_options.add_experimental_option(k, v)
        return chrome_options

    def create_driver_instance(self, name):
        driver = Chrome(options=self.options[name])
        self._set_navigator(driver)
        return DriverInstance(name, driver)

    def _set_navigator(self, driver):
        source = """Object.defineProperties(navigator,{webdriver:{get:()=> undefined}});"""
        add_script_to_evaluate_on_new_document(source, driver)

    def get_driver_name(self, request):
        if isinstance(request.render, str):
            name = request.render
        else:
            name = 'default'
        return name

    def get_driver_instance(self, request):
        name = self.get_driver_name(request)
        try:

            driver_instance = self.available_drivers[name].popleft()