Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#13 [bug-fix] hide elements after scroll #1

Merged
merged 1 commit into from
May 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Screenshot/Screenshot_Clipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def full_Screenshot(self, driver: WebDriver, save_path: str = '', image_name: st
time.sleep(2)
rectangles = []

self.hide_elements(driver, elements)

i = 0
while i < total_height:
ii = 0
Expand All @@ -100,6 +100,8 @@ def full_Screenshot(self, driver: WebDriver, save_path: str = '', image_name: st
if not previous is None:
driver.execute_script("window.scrollTo({0}, {1})".format(rectangle[0], rectangle[1]))
time.sleep(3)
self.hide_elements(driver, elements)

file_name = "part_{0}.png".format(part)
driver.get_screenshot_as_file(file_name)
screenshot = Image.open(file_name)
Expand Down