Skip to content

Selenium base UC mode: find_element work but find_elements doesn't #3091

Closed Answered by mdmintz
alicesin615 asked this question in Q&A
Discussion options

You must be logged in to vote

SeleniumBase uses a good user-agent by default. It's possible that you gave it a bad one that will detect your bot. It's best to leave it as the default value. Also, uc_subprocess doesn't change anything anymore, so you shouldn't need to use it.

For opening URLs in stealth mode, use uc_open_with_reconnect(url, reconnect_time), where reconnect_time is a time (in seconds) that is longer than the time it takes to finish loading the URL you want to navigate to. eg: uc_open_with_reconnect(url, 4). Then, you don't need to use sb.wait_for_ready_state_complete().

Assuming the selector is correct, sb.find_elements(selector) returns a list of WebElements. Then extract the link from each one.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@alicesin615
Comment options

@mdmintz
Comment options

Answer selected by mdmintz
Comment options

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
Category
Q&A
Labels
None yet
2 participants