ArturSpirin / YouTube-WebDriver-Tutorials

Python WebDriver Tutorials

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need help to convert some code to PowerShell or give me pointers to do so.

tarekahf opened this issue · comments

commented

The code is here:

https://github.com/ArturSpirin/YouTube-WebDriver-Tutorials/blob/master/dev_tools/NetworkTutorial.py

I need to make this code work for PowerShell.

Can you help me, please?

Tarek

i get this error:

PS C:\Users\user\Desktop\selenium> & C:/Users/user/AppData/Local/Programs/Python/Python310/python.exe c:/Users/user/Desktop/selenium/app.py

DevTools listening on ws://127.0.0.1:60984/devtools/browser/c736ea71-89fa-4e0e-b97e-1bbb62591f9b
Traceback (most recent call last):
File "c:\Users\user\Desktop\selenium\app.py", line 61, in
load_cookies(chrome, cookies_location)
File "c:\Users\user\Desktop\selenium\app.py", line 22, in load_cookies
driver.add_cookie(cookie)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1131, in add_cookie
self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict})
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 425, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain: Cookie 'domain' mismatch
(Session info: chrome=100.0.4896.127)
Stacktrace:
Backtrace:
Ordinal0 [0x00518BD3+2395091]
Ordinal0 [0x004AACA1+1944737]
Ordinal0 [0x0039D008+839688]
Ordinal0 [0x00403661+1259105]
Ordinal0 [0x003E4BBC+1133500]
Ordinal0 [0x003F4D62+1199458]
Ordinal0 [0x003E49D6+1133014]
Ordinal0 [0x003BEF76+978806]
Ordinal0 [0x003BFE86+982662]
GetHandleVerifier [0x006CC912+1719138]
GetHandleVerifier [0x0077B2CD+2434333]
GetHandleVerifier [0x005B4001+569937]
GetHandleVerifier [0x005B3066+565942]
Ordinal0 [0x004B265B+1975899]
Ordinal0 [0x004B72A8+1995432]
Ordinal0 [0x004B7395+1995669]
Ordinal0 [0x004C02F1+2032369]
BaseThreadInitThunk [0x7668FA29+25]
RtlGetAppContainerNamedObjectPath [0x77DA7A7E+286]
RtlGetAppContainerNamedObjectPath [0x77DA7A4E+238]

PS C:\Users\user\Desktop\selenium> [6836:4184:0426/051230.812:ERROR:device_event_log_impl.cc(214)] [05:12:30.812] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[6836:4184:0426/051230.817:ERROR:device_event_log_impl.cc(214)] [05:12:30.817] Bluetooth: bluetooth_adapter_winrt.cc:1165 RequestRadioAccessAsync failed: RadioAccessStatus::DeniedByUserWill not be able to change radio power.
[6836:4184:0426/051230.820:ERROR:device_event_log_impl.cc(214)] [05:12:30.820] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[6836:11940:0426/051328.577:ERROR:util.cc(126)] Can't create base directory: C:\Program Files\Google\GoogleUpdater
[6604:14708:0426/051428.600:ERROR:gpu_init.cc(446)] Passthrough is not supported, GL is disabled, ANGLE is