I have two scripts, the first, mail.py, scrapes hyperlinks from emails. The second, scrape.py, scrapes data from the links using Selenium and BeautifulSoup.
I have been using os.system('start cmd /c python scrape.py '+ link + ' && exit') to run scrape.py when a new email with a link arrives.
Sometimes I get an error with scrape.py but when I run it by manually inserting the link it works ok.
I'm new to python and I've read that os.system can be unstable. Is that correct? Is it likely to be the cause of the problem?
I'm under time pressure to finish the project so would prefer to keep the code as is unless that is the cause.
cmdto runstart, which will runcmdagain, which will runpython. Why not just runpythondirectly?importit. There are situations where it's useful or even necessary to run Python as a subprocess of itself, but this does not seem to be one of them.