0

The below simple example shows my problem. The link:

https://finance.yahoo.com/

contains a video which autoplays. It's not an mp4 or similar video file. I think it's a stream. I am trying to prevent it from loading and playing.

CODE:

from seleniumbase import SB

with SB(uc=True, locale_code="en", headless=True, block_images=True) as sb:

    link = "https://finance.yahoo.com/"
    
    print(f"\nOpening {link}")

    sb.wait_for_ready_state_complete(timeout=120)

    sb.activate_cdp_mode(link)

    sb.sleep(10)

    sb.cdp.save_screenshot(f"screenshot.png")

    print("Finished!")

Below screenshot shows the video was playing:

enter image description here

How can I prevent it?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.