Python Forum

Full Version: Parse a URL list stored in a CSV
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello any help greatly appreciated
urls stored in the CSV Coloum A lines 1-100, i would like to parse the links in each url to output to another CSV, so i can parse these links for certain data shown.

#working code below for one url
link_set = set()
for link in soup.find_all('a',{'class' : 'horse'}):
web_links = link.get("href")

import requests
from bs4 import BeautifulSoup
import csv
import requests
import time

#the csv file lines example
#ect, ect , ect

#prints screen urls in csv file
with open("course_links.csv") as infile:
reader = csv.DictReader(infile)
for link in reader:
res = requests.get(link['course_links'])

#prints screen urls in csv file
with open("course_links.csv", 'r') as file:
csv_file = csv.DictReader(file)
for row in csv_file: