-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
Hey guys,
I am starting a new project for a tool to automate a continuous task to save time, I will provide you with the real links as well as my source code.
On the tests done so far I notice this when I run with SB(uc=True) as sb: and I try to get_source_page() here is what I get:
<html><head></head><body> <script src="audio.js"></script><audio></audio> </body></html>
While on my screen the page opens, the site is loaded and the cookie pop-up constantly appears. I said to myself, so it's weird, I did another test, change the function, create my own, nothing works, until I change and remove the (uc=True) obviously I can no longer use uc_open_with_reconnect() but I can recover the page.
My conclusion is that the uc mode prevents this. Have you ever encountered the problem? or any ideas?
Here is my source code:
import time from seleniumbase import SB from utils.AuthClass import AuthClass def getcookie(auth: AuthClass): url = "https://serveur-prive.net/minecraft/nationsglory-2867/vote" cookies = [] with SB(uc=True) as sb: try: sb.driver.uc_open_with_reconnect(url, 4) time.sleep(5) source = sb.driver.get_page_source() print(source) with open("save_page.html", "w", encoding="utf-8") as f: f.write(source) cookies = sb.driver.get_cookies() except Exception as e: print("An error occurred:", e) return cookies def id1(auth: AuthClass): cookies = getcookie(auth) print("Cookies:", cookies)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments
-
Which version of SeleniumBase are you using? In Chrome 130, there were odd changes to the structure of the user-data-dir
, which caused an invisible built-in chrome audio extension to appear in UC Mode. The latest version of seleniumbase, 4.32.4
, should have patched that.
Beta Was this translation helpful? Give feedback.
All reactions
-
Ohh right I'm using the seleniumbase==4.32.3 version and your were right I was on Chrome 130 to. Thanks you a lot I'm gonna update it.
Beta Was this translation helpful? Give feedback.