Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

uc mode probleme to get_source_page #3234

ANONYme72 started this conversation in General
Discussion options

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)
You must be logged in to vote

Replies: 2 comments

Comment options

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.

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /