Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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,通过基于web的应用程序在浏览器中多步运行selenium_Python_Selenium - Fatal编程技术网

python,通过基于web的应用程序在浏览器中多步运行selenium

python,通过基于web的应用程序在浏览器中多步运行selenium,python,selenium,Python,Selenium,我目前只能访问不允许下载的学校计算机。我正在尝试通过基于web的python应用程序使用可变线程运行selenium。例如,我尝试了repl.it和在线Juypterlab,但遇到了问题。例如,我的代码看起来像是真的。它 from selenium import webdriver from selenium.webdriver.chrome.options import Options import _thread chrome_options = Options() chrome_opti

我目前只能访问不允许下载的学校计算机。我正在尝试通过基于web的python应用程序使用可变线程运行selenium。例如,我尝试了repl.it和在线Juypterlab,但遇到了问题。例如,我的代码看起来像是真的。它

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import _thread

chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')

def thread1():
  driver = webdriver.Chrome(options=chrome_options)
  driver.get("https://www.youtube.com")

def thread2():
  driver = webdriver.Chrome(options=chrome_options)
  driver.get("https://www.google.com")

_thread.start_new_thread(thread1, ())
_thread.start_new_thread(thread2, ())
我尝试的juypterlab代码看起来像

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import _thread

def thread1():
  driver = webdriver.Chrome('/Applications/chromedriver')
  driver.get("https://www.youtube.com")

def thread2():
  driver = webdriver.Chrome('/Applications/chromedriver')
  driver.get("https://www.google.com")

_thread.start_new_thread(thread1, ())
_thread.start_new_thread(thread2, ())
我与repl.it的问题是,我无法获得可变线程和在线juypterlab,我无法获得我的chromedriver工作的路径。在基于web的环境中,如何让可变的selenium踏板同时工作?我认为主要问题是无法在基于web的应用程序上获取路径