Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from bs4 import BeautifulSoup as bs
- import xml
- import urllib.request
- import requests
- import ssl
- import os
- from time import sleep
- ssl._create_default_https_context = ssl._create_unverified_context
- headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
- # header = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Sa
- def donwload(links:list):
- for link in links:
- url = link
- r = requests.get(url, allow_redirects=True)
- if r.status_code == 200:
- company_ = ''
- isExist = os.path.exists(company_)
- if not isExist:
- # Create a new directory because it does not exist
- os.makedirs(company_)
- print(f"{company_} directory is created!")
- filepath = company_ +
- if __name__ == '__main__':
- df = pd.read_excel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement