Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/svn/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python机器人Twitch查看器(Selenium)_Python_Selenium_Bots_Twitch - Fatal编程技术网

Python机器人Twitch查看器(Selenium)

Python机器人Twitch查看器(Selenium),python,selenium,bots,twitch,Python,Selenium,Bots,Twitch,因此,基本上我正在编写一个python脚本,该脚本登录到twitch帐户,并在那里生成一个查看器 但我的主要问题是如何使多个帐户都能使用它 如何隐藏所有窗口,以及如何处理多个selenium窗口 硒对这有好处吗?还是有其他的方法 from selenium import webdriver chrome_options = webdriver.ChromeOptions() chrome_options.add_argument("--mute-audio") driver

因此,基本上我正在编写一个python脚本,该脚本登录到twitch帐户,并在那里生成一个查看器

但我的主要问题是如何使多个帐户都能使用它

如何隐藏所有窗口,以及如何处理多个selenium窗口

硒对这有好处吗?还是有其他的方法

from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--mute-audio")
driver = webdriver.Chrome("D:\Downloads\chromedriver_win32\chromedriver.exe", chrome_options=chrome_options)


driver.minimize_window()

driver.get('https://www.twitch.tv/login')
search_form = driver.find_element_by_id('login-username')
search_form.send_keys('user')
search_form = driver.find_element_by_id('password-input')
search_form.send_keys('password')
search_form.submit()
driver.implicitly_wait(10)
driver.get('https://www.twitch.tv/channel')

您好,您将无法使用selenium创建机器人,因为即使您在twitch帐户twitch(如youtube)上连接多个帐户拥有一个查看您的IP地址的系统,如果多个连接来自同一台计算机,则不会增加视图数量。

您好,您将无法使用selenium创建一个机器人,因为即使您在twitch帐户twitch(如youtube)上连接多个帐户有一个系统可以查看您的IP地址,并且如果多个连接来自同一台计算机,则不会增加视图数量。

您完全可以使用Selenium和Python来完成此操作。要运行多个帐户,您必须利用多线程或创建多个驱动程序对象进行管理

线程中的多线程示例:

要隐藏webdrivers的控制台,必须使用“headless”选项运行它们。

不幸的是,Opera驱动程序不支持headless,所以您必须使用Chrome或Firefox


祝你好运

您完全可以使用Selenium和Python来实现这一点。要运行多个帐户,您必须利用多线程或创建多个驱动程序对象进行管理

线程中的多线程示例:

要隐藏webdrivers的控制台,必须使用“headless”选项运行它们。

不幸的是,Opera驱动程序不支持headless,所以您必须使用Chrome或Firefox


祝你好运

这听起来像是违反了与twitch的多个用户/开发人员协议。主要问题是:如何启动多个selenium实例?这听起来像是违反了与twitch的多个用户/开发人员协议。主要问题是:如何启动多个selenium实例?您不能使用代理选项吗?您不能使用代理选项?欢迎使用SO!虽然你提供的链接的内容可能会回答这个问题,但最好在你的帖子中包含答案的重要部分,并提供链接供参考,因为链接页面发生变化时,只有链接的答案才会失效。欢迎访问!虽然您提供的链接的内容可能会回答这个问题,但最好在您的帖子中包含答案的基本部分,并提供链接供参考,因为如果链接页面发生更改,仅链接的答案将无效。
from selenium import webdriver
import threading
import time

def test_logic():
    driver = webdriver.Firefox()
    url = 'https://www.google.co.in'
    driver.get(url)
    # Implement your test logic
    time.sleep(2)
    driver.quit()

N = 5   # Number of browsers to spawn
thread_list = list()

# Start test
for i in range(N):
    t = threading.Thread(name='Test {}'.format(i), target=test_logic)
    t.start()
    time.sleep(1)
    print t.name + ' started!'
    thread_list.append(t)

# Wait for all thre<ads to complete
for thread in thread_list:
    thread.join()

print 'Test completed!'
from selenium import webdriver
from time import sleep

# The profile directory which Opera VPN was enabled manually using the GUI
opera_profile = '/home/user-directory/.config/opera' 
options = webdriver.ChromeOptions()
options.add_argument('user-data-dir=' + opera_profile)
driver = webdriver.Opera(options=options)
driver.get('https://whatismyipaddress.com')
sleep(10)
driver.quit()
from selenium import webdriver from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")