-
Notifications
You must be signed in to change notification settings - Fork 1.4k
'WebDriver' object has no attribute 'save_element_as_image_file' #3491
IndrajeethY
started this conversation in
General
-
'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)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
That's not part of WebDriver. It's part of SeleniumBase. Example:
self.save_element_as_image_file(selector, file_name, folder)
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
how do i implement it tho
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment