Skip to content Skip to sidebar Skip to footer

How To Automate This Downloading Prompt Using Python?

I made a crawler for downloading torrent from a specific torrent site using selenium and python. The download will happen when someone clicks on the 'magnet download' link and clic

Solution 1:

You can disable it using the profile itself

from selenium import webdriver
chrome_options.add_experimental_option("prefs", {'protocol_handler.allowed_origin_protocol_pairs': 
{"https://www.1377x.to":{"magnet": True}}})
d = webdriver.Chrome(options=chrome_options)
d.get("http://example.com/url/to/magnet/site")
elem = d.find_element_by_css_selector("a[href*=magnet]")
elem.click()

Post a Comment for "How To Automate This Downloading Prompt Using Python?"