pydoll-python 2.14.0__tar.gz → 2.15.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/PKG-INFO +1 -1
  2. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/chromium/base.py +6 -1
  3. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/requests/request.py +17 -13
  4. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/tab.py +13 -5
  5. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/interactions/keyboard.py +9 -3
  6. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pyproject.toml +1 -1
  7. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/LICENSE +0 -0
  8. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/README.md +0 -0
  9. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/__init__.py +0 -0
  10. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/__init__.py +0 -0
  11. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/chromium/__init__.py +0 -0
  12. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/chromium/chrome.py +0 -0
  13. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/chromium/edge.py +0 -0
  14. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/interfaces.py +0 -0
  15. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/managers/__init__.py +0 -0
  16. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/managers/browser_options_manager.py +0 -0
  17. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/managers/browser_process_manager.py +0 -0
  18. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/managers/proxy_manager.py +0 -0
  19. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/managers/temp_dir_manager.py +0 -0
  20. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/options.py +0 -0
  21. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/requests/__init__.py +0 -0
  22. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/browser/requests/response.py +0 -0
  23. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/__init__.py +0 -0
  24. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/browser_commands.py +0 -0
  25. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/dom_commands.py +0 -0
  26. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/fetch_commands.py +0 -0
  27. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/input_commands.py +0 -0
  28. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/network_commands.py +0 -0
  29. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/page_commands.py +0 -0
  30. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/runtime_commands.py +0 -0
  31. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/storage_commands.py +0 -0
  32. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/commands/target_commands.py +0 -0
  33. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/connection/__init__.py +0 -0
  34. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/connection/connection_handler.py +0 -0
  35. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/connection/managers/__init__.py +0 -0
  36. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/connection/managers/commands_manager.py +0 -0
  37. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/connection/managers/events_manager.py +0 -0
  38. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/constants.py +0 -0
  39. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/decorators.py +0 -0
  40. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/elements/__init__.py +0 -0
  41. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/elements/mixins/__init__.py +0 -0
  42. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/elements/mixins/find_elements_mixin.py +0 -0
  43. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/elements/web_element.py +0 -0
  44. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/exceptions.py +0 -0
  45. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/interactions/__init__.py +0 -0
  46. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/interactions/iframe.py +0 -0
  47. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/interactions/scroll.py +0 -0
  48. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/__init__.py +0 -0
  49. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/base.py +0 -0
  50. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/browser/__init__.py +0 -0
  51. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/browser/events.py +0 -0
  52. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/browser/methods.py +0 -0
  53. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/browser/types.py +0 -0
  54. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/debugger/types.py +0 -0
  55. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/dom/__init__.py +0 -0
  56. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/dom/events.py +0 -0
  57. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/dom/methods.py +0 -0
  58. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/dom/types.py +0 -0
  59. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/emulation/types.py +0 -0
  60. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/fetch/__init__.py +0 -0
  61. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/fetch/events.py +0 -0
  62. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/fetch/methods.py +0 -0
  63. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/fetch/types.py +0 -0
  64. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/input/__init__.py +0 -0
  65. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/input/events.py +0 -0
  66. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/input/methods.py +0 -0
  67. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/input/types.py +0 -0
  68. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/io/types.py +0 -0
  69. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/network/__init__.py +0 -0
  70. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/network/events.py +0 -0
  71. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/network/methods.py +0 -0
  72. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/network/types.py +0 -0
  73. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/page/__init__.py +0 -0
  74. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/page/events.py +0 -0
  75. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/page/methods.py +0 -0
  76. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/page/types.py +0 -0
  77. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/runtime/__init__.py +0 -0
  78. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/runtime/events.py +0 -0
  79. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/runtime/methods.py +0 -0
  80. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/runtime/types.py +0 -0
  81. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/security/types.py +0 -0
  82. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/storage/__init__.py +0 -0
  83. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/storage/events.py +0 -0
  84. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/storage/methods.py +0 -0
  85. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/storage/types.py +0 -0
  86. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/target/__init__.py +0 -0
  87. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/target/events.py +0 -0
  88. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/target/methods.py +0 -0
  89. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/protocol/target/types.py +0 -0
  90. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/py.typed +0 -0
  91. {pydoll_python-2.14.0 → pydoll_python-2.15.0}/pydoll/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydoll-python
3
- Version: 2.14.0
3
+ Version: 2.15.0
4
4
  Summary: Pydoll is a library for automating chromium-based browsers without a WebDriver, offering realistic interactions.
5
5
  License-File: LICENSE
6
6
  Author: Thalison Fernandes
@@ -414,7 +414,12 @@ class Browser(ABC): # noqa: PLR0904
414
414
  return await self._execute_command(StorageCommands.set_cookies(cookies, browser_context_id))
415
415
 
416
416
  async def get_cookies(self, browser_context_id: Optional[str] = None) -> list[Cookie]:
417
- """Get all cookies from browser or context."""
417
+ """Get all cookies from browser or context.
418
+
419
+ Note:
420
+ This method does not work with native incognito mode (--incognito flag).
421
+ For incognito mode, use ``tab.get_cookies()`` instead.
422
+ """
418
423
  response: GetCookiesResponse = await self._execute_command(
419
424
  StorageCommands.get_cookies(browser_context_id)
420
425
  )
@@ -15,36 +15,40 @@ from pydoll.commands.runtime_commands import RuntimeCommands
15
15
  from pydoll.constants import Scripts
16
16
  from pydoll.exceptions import HTTPError
17
17
  from pydoll.protocol.fetch.types import HeaderEntry
18
- from pydoll.protocol.network.events import NetworkEvent, ResponseReceivedExtraInfoEventParams
18
+ from pydoll.protocol.network.events import (
19
+ NetworkEvent,
20
+ RequestWillBeSentEvent,
21
+ RequestWillBeSentExtraInfoEvent,
22
+ ResponseReceivedEvent,
23
+ ResponseReceivedExtraInfoEvent,
24
+ ResponseReceivedExtraInfoEventParams,
25
+ )
19
26
  from pydoll.protocol.network.types import CookieParam
20
27
 
21
28
  logger = logging.getLogger(__name__)
22
29
 
30
+ RequestReceivedEvent = Union[
31
+ ResponseReceivedEvent,
32
+ ResponseReceivedExtraInfoEvent,
33
+ ]
34
+ RequestSentEvent = Union[
35
+ RequestWillBeSentEvent,
36
+ RequestWillBeSentExtraInfoEvent,
37
+ ]
38
+
23
39
  if TYPE_CHECKING:
24
40
  from pydoll.browser.tab import Tab
25
41
  from pydoll.protocol.network.events import (
26
- RequestWillBeSentEvent,
27
42
  RequestWillBeSentEventParams,
28
- RequestWillBeSentExtraInfoEvent,
29
43
  RequestWillBeSentExtraInfoEventParams,
30
- ResponseReceivedEvent,
31
44
  ResponseReceivedEventParams,
32
- ResponseReceivedExtraInfoEvent,
33
45
  )
34
46
  from pydoll.protocol.runtime.methods import EvaluateResponse
35
47
 
36
- RequestReceivedEvent = Union[
37
- ResponseReceivedEvent,
38
- ResponseReceivedExtraInfoEvent,
39
- ]
40
48
  RequestReceivedEventParams = Union[
41
49
  ResponseReceivedEventParams,
42
50
  ResponseReceivedExtraInfoEventParams,
43
51
  ]
44
- RequestSentEvent = Union[
45
- RequestWillBeSentEvent,
46
- RequestWillBeSentExtraInfoEvent,
47
- ]
48
52
  RequestSentEventParams = Union[
49
53
  RequestWillBeSentEventParams,
50
54
  RequestWillBeSentExtraInfoEventParams,
@@ -61,7 +61,6 @@ from pydoll.protocol.runtime.methods import (
61
61
  SerializationOptions,
62
62
  )
63
63
  from pydoll.protocol.runtime.types import CallArgument
64
- from pydoll.protocol.storage.methods import GetCookiesResponse
65
64
  from pydoll.utils import (
66
65
  decode_base64_to_bytes,
67
66
  has_return_outside_function,
@@ -77,6 +76,7 @@ if TYPE_CHECKING:
77
76
  )
78
77
  from pydoll.protocol.fetch.types import AuthChallengeResponseType, HeaderEntry, RequestStage
79
78
  from pydoll.protocol.network.events import RequestWillBeSentEvent
79
+ from pydoll.protocol.network.methods import GetCookiesResponse as NetworkGetCookiesResponse
80
80
  from pydoll.protocol.network.methods import GetResponseBodyResponse
81
81
  from pydoll.protocol.network.types import (
82
82
  Cookie,
@@ -88,7 +88,7 @@ if TYPE_CHECKING:
88
88
  from pydoll.protocol.page.events import FileChooserOpenedEvent
89
89
  from pydoll.protocol.page.methods import CaptureScreenshotResponse, PrintToPDFResponse
90
90
  from pydoll.protocol.runtime.methods import CallFunctionOnResponse, EvaluateResponse
91
- from pydoll.protocol.storage.methods import GetCookiesResponse
91
+ from pydoll.protocol.storage.methods import GetCookiesResponse as StorageGetCookiesResponse
92
92
 
93
93
  logger = logging.getLogger(__name__)
94
94
 
@@ -468,10 +468,18 @@ class Tab(FindElementsMixin):
468
468
  async def get_cookies(self) -> list[Cookie]:
469
469
  """Get all cookies accessible from current page."""
470
470
  logger.debug('Fetching cookies for current page')
471
- response: GetCookiesResponse = await self._execute_command(
472
- StorageCommands.get_cookies(self._browser_context_id)
471
+ if self._browser_context_id:
472
+ response_storage: StorageGetCookiesResponse = await self._execute_command(
473
+ StorageCommands.get_cookies(self._browser_context_id)
474
+ )
475
+ cookies = response_storage['result']['cookies']
476
+ logger.debug(f'Fetched {len(cookies)} cookies')
477
+ return cookies
478
+
479
+ response_network: NetworkGetCookiesResponse = await self._execute_command(
480
+ NetworkCommands.get_cookies()
473
481
  )
474
- cookies = response['result']['cookies']
482
+ cookies = response_network['result']['cookies']
475
483
  logger.debug(f'Fetched {len(cookies)} cookies')
476
484
  return cookies
477
485
 
@@ -233,11 +233,17 @@ class Keyboard:
233
233
 
234
234
  async def _type_char(self, char: str):
235
235
  """Type a single character."""
236
- command = InputCommands.dispatch_key_event(
237
- type=KeyEventType.CHAR,
236
+ command_down = InputCommands.dispatch_key_event(
237
+ type=KeyEventType.KEY_DOWN,
238
238
  text=char,
239
+ unmodified_text=char,
239
240
  )
240
- await self._executor._execute_command(command)
241
+ await self._executor._execute_command(command_down)
242
+
243
+ command_up = InputCommands.dispatch_key_event(
244
+ type=KeyEventType.KEY_UP,
245
+ )
246
+ await self._executor._execute_command(command_up)
241
247
 
242
248
  async def _type_backspace(self):
243
249
  """Send backspace keypress."""
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pydoll-python"
3
- version = "2.14.0"
3
+ version = "2.15.0"
4
4
  description = "Pydoll is a library for automating chromium-based browsers without a WebDriver, offering realistic interactions."
5
5
  authors = ["Thalison Fernandes <thalissfernandes99@gmail.com>"]
6
6
  readme = "README.md"
File without changes
File without changes