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

Open site and wait for manual input / What does the log-output mean? #3458

Rapid1898-code started this conversation in General
Discussion options

Hello - i try to use SeleniumBase in uc-mode to open a page using the following code:

from bs4 import BeautifulSoup
from seleniumbase import SB
link = "https://auth.kleinanzeigen.de/login"
with SB(uc=True) as sb:
 sb.uc_open_with_reconnect(link, reconnect_time="breakpoint")
 input("Press!")
 soup = BeautifulSoup (sb.driver.page_source, 'lxml')

When i run the program i see that the page is opening fine - but then i get this output in the log
Why do i not get the "Press!" info in the log?

[3] > c:\devneu\.venv\seleniumall\lib\site-packages\seleniumbase\undetected\__init__.py(432)
 ...
 420 def reconnect(self, timeout=0.1):
 421 """This can be useful when sites use heavy detection methods:
 422 - Stops the chromedriver service that runs in the background.
 423 - Starts the chromedriver service that runs in the background.
 424 - Recreates the session."""
 425 if hasattr(self, "service"):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 431 if timeout.lower() == "breakpoint":
 432 -> breakpoint() # To continue:
 433 pass # Type "c" & press ENTER!
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 431 if timeout.lower() == "breakpoint":
 432 -> breakpoint() # To continue:
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 431 if timeout.lower() == "breakpoint":
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 426 with suppress(Exception):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 426 with suppress(Exception):
 426 with suppress(Exception):
 426 with suppress(Exception):
 427 if self.service.is_connectable():
 428 self.stop_client()
 429 self.service.stop()
 430 if isinstance(timeout, str):
 431 if timeout.lower() == "breakpoint":
 432 -> breakpoint() # To continue:
 433 pass # Type "c" & press ENTER!
 434 else:
 435 time.sleep(timeout)
 436 with suppress(Exception):
 437 self.service.start()
 438 with suppress(Exception):
 439 self.start_session()
 440 with suppress(Exception):
 441 if self.current_url.startswith("chrome-extension://"):
 442 self.close()
 443 if self.service.is_connectable():
 444 self.stop_client()
 445 self.service.stop()
 446 self.service.start()
 447 ...
(Pdb+)
You must be logged in to vote

Replies: 4 comments

Comment options

That's not log output. That's a Python breakpoint(). It pauses code execution so that it can wait for manual input.
Type c and press Enter to continue from the breakpoint. You don't need input("Press!") to pause the script.

You must be logged in to vote
0 replies
Comment options

I don ́t understand.
When i press c and enter the opened window is only closing.
But i want to have the user input something int he opened window (= his credentials) - then he should press some key - and then the program should work on the next steps (like parsing etc.)

You must be logged in to vote
0 replies
Comment options

Sorry - i think i understand now.
When i don ́t use the break point in the statement i think it will work like
sb.uc_open_with_reconnect(link)

Are there some parameters i have to use when i site is really challenging and has a very strong blocking?

You must be logged in to vote
0 replies
Comment options

CDP Mode is the key to maximum stealth.

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 によって変換されたページ (->オリジナル) /