open multiple sites in python Script using web browser package

including required packages-
! pip install random
! pip install webbrowser
import random
import webbrowser
import os
adding multiple sites in a list-
ls=['/2016/08/business-analytics-on-sales-data-of.html', '/recommendation-engine-market-basket.html', '/2016/08/optimizing-e-commerce-site-using.html'
   ,'/2016/08/8-simple-ways-to-increse-your-blog.html', '/2016/08/business-analytics-on-sales-data-of.html',
   '/2017/12/gaussian-state-space-model-in-r-using.html', '/2017/09/assumptions-of-linear-regression.html',
   '/2017/09/neural-network-forward-propagation-in.html', '/2018/06/lda-linear-discriminant-analysis-where.html',
   '/2018/10/religious-demographics-of-india-in.html', '/2020/04/forecasting-total-deaths-from.html',
   '/2019/11/automatic-ticket-resolution-for.html', '/2019/09/sentiment-analysis-using-nltk-and.html', '/2019/07/deep-learning-with-h2o-in-python.html',
   '/2019/07/how-to-survive-in-data-science-and.html']
from time import sleep
url='https://machinelearningstories.blogspot.com'
for i in range(30):
    item=random.choice(ls)
    updated_url= url+item
    print(updated_url)
    webbrowser.get('chrome').open(updated_url) # opening url
    sleep(5)
    
os.system("pkill -f Chrome") 
#os.system("pkill -f chrome") 

Comments

Popular posts from this blog

Speech Recognition using PyAudio and SpeechRecognition Libraries

Automatically open and do some actions on web pages in python using different packages