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

'WebDriver' object has no attribute 'save_element_as_image_file' #3491

IndrajeethY started this conversation in General
Discussion options

'WebDriver' object has no attribute 'save_element_as_image_file'

from seleniumbase import Driver
driver = Driver()
import uuid
import requests
driver.get("https://example.com")
driver.sleep(5)
cookies = driver.get_cookies()
cookie_dict = {cookie['name']: cookie['value'] for cookie in cookies}
if driver.is_element_visible("img#captchalog"):
 screenshot_name = f"captcha_{uuid.uuid4()}.png"
 driver.save_element_as_image_file("img#captchalog", screenshot_name)
You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

That's not part of WebDriver. It's part of SeleniumBase. Example:

self.save_element_as_image_file(selector, file_name, folder)
You must be logged in to vote
1 reply
Comment options

how do i implement it tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

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