【发布时间】:2020-06-08 12:44:03
【问题描述】:
我尝试从 soundcloud 自动播放多个曲目。
我正在使用 Selenium 打开浏览器并访问 Soundcloud,然后播放曲目。(它可以使用一次)
但 Soundcloud 会阻止这种情况,如果一首曲目开始播放,另一首已经播放的曲目将停止。
有什么建议吗?
到目前为止,这是我在 Python 中的代码:
from selenium import webdriver
driver = webdriver.Chrome(
r"C:\Users\qwerty\PycharmProjects\venv\Lib\site-packages\selenium\webdriver\chrome\chromedriver.exe")
driver.get("https://soundcloud.com/johnnyvandenberg/bring-her-back-home")
driver.find_element_by_class_name("sc-button-play").click()
for i in range(1,5):
driver.execute_script('''window.open("https://soundcloud.com/johnnyvandenberg/bring-her-back-home","_blank");''')
driver.find_element_by_class_name("sc-button-play").click()
【问题讨论】:
-
因此,如果 Soundcloud 不允许,这就是功能,您无法使用 Selenium 或其他工具绕过此功能。
-
@Villa_7 它确实在 2 个不同的浏览器中同时播放。也许还有其他方法可以绕过它?
标签: python selenium selenium-webdriver automation bots