-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open site and wait for manual input / What does the log-output mean? #3458
-
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+)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
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.)
Beta Was this translation helpful? Give feedback.
All reactions
-
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?
Beta Was this translation helpful? Give feedback.
All reactions
-
CDP Mode is the key to maximum stealth.
Beta Was this translation helpful? Give feedback.