import os import time # session_char = 'sou' # sub_dir = 'australia' #sub_dirs = [ # "california","iowa","texas","nebraska", "kansas","illinois","minnesota", "indiana", "north_dakota", "wisconsin" #] sub_dirs = [ "eudr" ] web_arrs = [[ "ec.europa.eu/environment/forests/deforestation_regulation.htm", "globalforestcoalition.org/", "fao.org/forestry/deforestation", "forest-observatory.ec.europa.eu/", "ec.europa.eu/newsroom/env/newsletter-archives/56257", "dnv.com/assurance/eudr-eu-deforestation-regulation.html", "kpmg.com/global/en/home/insights/eu-deforestation-regulation.html", "european-forests.org/", "green-business.ec.europa.eu/deforestation-eu", "unep.org/resources/eu-deforestation-regulation", "worldwildlife.org/deforestation", "ec.europa.eu/environment/", "iucn.org/", "earthobservatory.nasa.gov/topics/deforestation", "eea.europa.eu/", "forest-trends.org/", "greenpeace.org/eu/deforestation/", "wwf.eu/deforestation", "birdlife.org/europe-and-central-asia/", "clientearth.org/eudr/", "nature.org/en-us/deforestation", "chathamhouse.org/deforestation", "pefc.org/deforestation", "forestpeoples.org/", "wri.org/forests", "environmentalpaper.org/", "circulareconomy.europa.eu/", "fern.org/deforestation", "ifoam.bio/forests", "rainforest-alliance.org/", "forest500.org/", "cbd.int/forest/", "conservation.org/deforestation", "landcoalition.org/", "legambiente.eu/", "fsc.org/", "eurosif.org/", "ec.europa.eu/commission/presscorner/deforestation-regulation", "ipcc.ch/forestry", "esa.int/Applications/Observing_the_Earth", "cifor.org/", "sdg6data.org/", "internationaltreefoundation.org/", "ecovadis.com/resources/deforestation-regulation/", "ifc.org/forestry", "csreurope.org/", "oecd.org/environment/forests", "socialfinance.org.uk/", "giz.de/en/", "canopyplanet.org/", "naturebasedsolutionsinitiative.org/" ] ] num = 0 for sub_dir in sub_dirs: web_arr = web_arrs[num] session_char = sub_dir print(session_char) for i in range(0, len(web_arr)): tmux_cmd = 'tmux new-session -d -s ' + session_char + str(i) os.system(tmux_cmd) tmux_cmd = f'tmux send-keys -t {session_char}{i} "cd publish_blogs_ai" Enter' os.system(tmux_cmd) tmux_cmd = f'tmux send-keys -t {session_char}{i} "python3.8 web_scrape.py {web_arr[i]} {sub_dir}" Enter' os.system(tmux_cmd) time.sleep(1) print(i) num = num +1